diff --git a/project.hxp b/project.hxp index 6a8a059f4..dc20650fd 100644 --- a/project.hxp +++ b/project.hxp @@ -767,6 +767,10 @@ class Project extends HXProject // Enable OpenFL's error handler. Required for the crash logger. setHaxedef("openfl-enable-handle-error"); + // Disable a macro in Lime that generates a random number for Assets.cache.version every build. + // This doesn't seem to be of any use and it causes lime.utils.AssetCache to be re-compiled on every build. + setHaxedef("lime_disable_assets_version"); + // Enable stack trace tracking. Good for debugging but has a (minor) performance impact. setHaxedef("HXCPP_CHECK_POINTER"); setHaxedef("HXCPP_STACK_LINE"); diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index 057429055..f89a5e202 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -5,6 +5,7 @@ import funkin.mobile.ui.FunkinHitbox; #end import funkin.save.Save; import funkin.util.WindowUtil; +import funkin.util.HapticUtil.HapticsMode; /** * A core class which provides a store of user-configurable, globally relevant values. @@ -147,20 +148,42 @@ class Preferences } /** - * If enabled, vibration will be enabled. - * @default `true` + * If enabled, haptic feedback will be enabled. + * @default `All` */ - public static var vibration(get, set):Bool; + public static var hapticsMode(get, set):HapticsMode; - static function get_vibration():Bool + static function get_hapticsMode():HapticsMode { - return Save?.instance?.options?.vibration ?? true; + var value = Save?.instance?.options?.hapticsMode ?? "All"; + + return switch (value) + { + case "None": + HapticsMode.NONE; + case "Notes Only": + HapticsMode.NOTES_ONLY; + default: + HapticsMode.ALL; + }; } - static function set_vibration(value:Bool):Bool + static function set_hapticsMode(value:HapticsMode):HapticsMode { + var string; + + switch (value) + { + case HapticsMode.NONE: + string = "None"; + case HapticsMode.NOTES_ONLY: + string = "Notes Only"; + default: + string = "All"; + }; + var save:Save = Save.instance; - save.options.vibration = value; + save.options.hapticsMode = string; save.flush(); return value; } diff --git a/source/funkin/modding/events/ScriptEvent.hx b/source/funkin/modding/events/ScriptEvent.hx index 6f4742a29..6710e4138 100644 --- a/source/funkin/modding/events/ScriptEvent.hx +++ b/source/funkin/modding/events/ScriptEvent.hx @@ -255,7 +255,7 @@ class HoldNoteScriptEvent extends NoteScriptEvent */ public var doesNotesplash:Bool = false; - public function new(type:ScriptEventType, holdNote:SustainTrail, healthChange:Float, score:Int, isComboBreak:Bool, cancelable:Bool = false):Void + public function new(type:ScriptEventType, holdNote:SustainTrail, healthChange:Float, score:Int, isComboBreak:Bool, comboCount:Int = 0, cancelable:Bool = false):Void { super(type, null, healthChange, comboCount, true); this.holdNote = holdNote; diff --git a/source/funkin/play/PauseSubState.hx b/source/funkin/play/PauseSubState.hx index b732d92f4..916b1a6a7 100644 --- a/source/funkin/play/PauseSubState.hx +++ b/source/funkin/play/PauseSubState.hx @@ -213,7 +213,7 @@ class PauseSubState extends MusicBeatSubState #if FEATURE_MOBILE_ADVERTISEMENTS extension.admob.Admob.onEvent.add(onBannerEvent); - funkin.mobile.util.AdMobUtil.addBanner(extension.admob.AdmobBannerSize.BANNER, extension.admob.AdmobBannerAlign.TOP_LEFT); + funkin.mobile.util.AdMobUtil.addBanner(extension.admob.AdmobBannerSize.BANNER, extension.admob.AdmobBannerAlign.TOP_CENTER); #end super.create(); @@ -279,6 +279,7 @@ class PauseSubState extends MusicBeatSubState failedAdPlaceHolder = new FunkinSprite(0, 0); failedAdPlaceHolder.makeSolidColor(Math.floor(320 * scale), Math.floor(50 * scale), FlxColor.RED); failedAdPlaceHolder.updateHitbox(); + failedAdPlaceHolder.screenCenter(X); failedAdPlaceHolder.scrollFactor.set(0, 0); add(failedAdPlaceHolder); } diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 0978839e0..adfc28c3e 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2517,7 +2517,7 @@ class PlayState extends MusicBeatSubState { // Call an event to allow canceling the note miss. // NOTE: This is what handles the character animations! - var event:NoteScriptEvent = new NoteScriptEvent(NOTE_MISS, note, Constants.HEALTH_MISS_PENALTY, 0, true); + var event:NoteScriptEvent = new NoteScriptEvent(NOTE_MISS, note, Constants.HEALTH_MISS_PENALTY, Highscore.tallies.combo, true); dispatchEvent(event); // Calling event.cancelEvent() skips all the other logic! Neat! @@ -2584,7 +2584,7 @@ class PlayState extends MusicBeatSubState var healthChange = healthChangeUncapped.clamp(healthChangeMax, 0); var scoreChange = Std.int(Constants.SCORE_HOLD_DROP_PENALTY_PER_SECOND * remainingLengthSec); - var event:HoldNoteScriptEvent = new HoldNoteScriptEvent(NOTE_HOLD_DROP, holdNote, healthChange, scoreChange, true); + var event:HoldNoteScriptEvent = new HoldNoteScriptEvent(NOTE_HOLD_DROP, holdNote, healthChange, scoreChange, true, Highscore.tallies.combo); dispatchEvent(event); trace('Penalizing score by ${event.score} and health by ${event.healthChange} for dropping hold note (is combo break: ${event.isComboBreak})!'); diff --git a/source/funkin/play/event/FocusCameraSongEvent.hx b/source/funkin/play/event/FocusCameraSongEvent.hx index 3198e0792..137a9fbc5 100644 --- a/source/funkin/play/event/FocusCameraSongEvent.hx +++ b/source/funkin/play/event/FocusCameraSongEvent.hx @@ -218,9 +218,21 @@ class FocusCameraSongEvent extends SongEvent 'Smooth Step In' => 'smoothStepIn', 'Smooth Step Out' => 'smoothStepOut', 'Smooth Step In/Out' => 'smoothStepInOut', + 'Smoother Step In' => 'smootherStepIn', + 'Smoother Step Out' => 'smootherStepOut', + 'Smoother Step In/Out' => 'smootherStepInOut', 'Elastic In' => 'elasticIn', 'Elastic Out' => 'elasticOut', 'Elastic In/Out' => 'elasticInOut', + 'Back In' => 'backIn', + 'Back Out' => 'backOut', + 'Back In/Out' => 'backInOut', + 'Bounce In' => 'bounceIn', + 'Bounce Out' => 'bounceOut', + 'Bounce In/Out' => 'bounceInOut', + 'Circ In' => 'circIn', + 'Circ Out' => 'circOut', + 'Circ In/Out' => 'circInOut', 'Instant (Ignores duration)' => 'INSTANT', 'Classic (Ignores duration)' => 'CLASSIC' ] diff --git a/source/funkin/play/event/ScrollSpeedEvent.hx b/source/funkin/play/event/ScrollSpeedEvent.hx index bc0e99ba5..227fa0be2 100644 --- a/source/funkin/play/event/ScrollSpeedEvent.hx +++ b/source/funkin/play/event/ScrollSpeedEvent.hx @@ -149,9 +149,21 @@ class ScrollSpeedEvent extends SongEvent 'Smooth Step In' => 'smoothStepIn', 'Smooth Step Out' => 'smoothStepOut', 'Smooth Step In/Out' => 'smoothStepInOut', + 'Smoother Step In' => 'smootherStepIn', + 'Smoother Step Out' => 'smootherStepOut', + 'Smoother Step In/Out' => 'smootherStepInOut', 'Elastic In' => 'elasticIn', 'Elastic Out' => 'elasticOut', - 'Elastic In/Out' => 'elasticInOut' + 'Elastic In/Out' => 'elasticInOut', + 'Back In' => 'backIn', + 'Back Out' => 'backOut', + 'Back In/Out' => 'backInOut', + 'Bounce In' => 'bounceIn', + 'Bounce Out' => 'bounceOut', + 'Bounce In/Out' => 'bounceInOut', + 'Circ In' => 'circIn', + 'Circ Out' => 'circOut', + 'Circ In/Out' => 'circInOut' ] }, { diff --git a/source/funkin/play/event/ZoomCameraSongEvent.hx b/source/funkin/play/event/ZoomCameraSongEvent.hx index 0c34028c8..d3635f893 100644 --- a/source/funkin/play/event/ZoomCameraSongEvent.hx +++ b/source/funkin/play/event/ZoomCameraSongEvent.hx @@ -158,9 +158,21 @@ class ZoomCameraSongEvent extends SongEvent 'Smooth Step In' => 'smoothStepIn', 'Smooth Step Out' => 'smoothStepOut', 'Smooth Step In/Out' => 'smoothStepInOut', + 'Smoother Step In' => 'smootherStepIn', + 'Smoother Step Out' => 'smootherStepOut', + 'Smoother Step In/Out' => 'smootherStepInOut', 'Elastic In' => 'elasticIn', 'Elastic Out' => 'elasticOut', - 'Elastic In/Out' => 'elasticInOut' + 'Elastic In/Out' => 'elasticInOut', + 'Back In' => 'backIn', + 'Back Out' => 'backOut', + 'Back In/Out' => 'backInOut', + 'Bounce In' => 'bounceIn', + 'Bounce Out' => 'bounceOut', + 'Bounce In/Out' => 'bounceInOut', + 'Circ In' => 'circIn', + 'Circ Out' => 'circOut', + 'Circ In/Out' => 'circInOut' ] } ]); diff --git a/source/funkin/play/notes/NoteVibrationsHandler.hx b/source/funkin/play/notes/NoteVibrationsHandler.hx index 46804d794..e37392b64 100644 --- a/source/funkin/play/notes/NoteVibrationsHandler.hx +++ b/source/funkin/play/notes/NoteVibrationsHandler.hx @@ -1,6 +1,7 @@ package funkin.play.notes; import funkin.util.HapticUtil; +import funkin.util.HapticUtil.HapticsMode; /** * Handles vibrations on note presses. @@ -60,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); + if (stackingAmplitude > 0) HapticUtil.vibrate(0, 0.01, stackingAmplitude, [HapticsMode.ALL, HapticsMode.NOTES_ONLY]); } /** @@ -83,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); + if (stackingAmplitude > 0) HapticUtil.vibrate(0, 0.01, stackingAmplitude, [HapticsMode.ALL, HapticsMode.NOTES_ONLY]); for (currentNoteStatus in noteStatuses) { diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 64b8935fa..0a11fca3e 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -121,7 +121,7 @@ class Save flashingLights: true, zoomCamera: true, debugDisplay: false, - vibration: true, + hapticsMode: 'All', autoPause: true, vsyncMode: 'Off', strumlineBackgroundOpacity: 0, @@ -1435,10 +1435,10 @@ typedef SaveDataOptions = var debugDisplay:Bool; /** - * If enabled, vibration will be enabled. - * @default `true` + * If enabled, haptic feedback will be enabled. + * @default `All` */ - var vibration:Bool; + var hapticsMode:String; /** * If enabled, the game will automatically pause when tabbing out. diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx index 2c9de5c62..01b7c59ac 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx @@ -22,7 +22,8 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu public var charSelectScroll:ScrollView; public var charIconName:Label; - var currentCharButton:Button; + var currentCharButton:Null