diff --git a/CHANGELOG.md b/CHANGELOG.md index 61b16c821..f33c89e01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,89 +15,112 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [MOBILE] Graphics are compressed using the ASTC algorithm, decreasing memory usage in exchange for a slightly bigger file size. - [MOBILE] Added haptic feedback to several areas in the game. - A whopping ZERO new songs! Woah! -- The Chart Editor can now detect and warn the user for stacked notes. ([8cae34e](https://github.com/FunkinCrew/Funkin/commit/8cae34eed711bff70e5348ffc6178a0fd69b5846)) - by @NotHyper-474 in [#3574](https://github.com/FunkinCrew/Funkin/pull/3574) +- Added null-safety to a bunch of classes within the source code. +- Added a blank `Object` class for scripts to extend, and made `FlxObject` and `FlxBasic` scriptable. ([1c36548](https://github.com/FunkinCrew/Funkin/commit/1c36548861a54e2a8ae49f715056139ce31bbd83)) - by @cyn0x8 in [#3119](https://github.com/FunkinCrew/Funkin/pull/3119) +- The Chart Editor now highlights and deletes stacked notes and using a customizable threshold. ([8cae34e](https://github.com/FunkinCrew/Funkin/commit/8cae34eed711bff70e5348ffc6178a0fd69b5846)) - by @NotHyper-474 in [#3574](https://github.com/FunkinCrew/Funkin/pull/3574) +- Added the ability to press the Chart Editor keybind in Freeplay with a song capsule selected. ([066c2d3](https://github.com/FunkinCrew/Funkin/commit/066c2d3db04162d3df6af883066fc91e05988d58)) - by @Lasercar in [#4114](https://github.com/FunkinCrew/Funkin/pull/4114) +- Added more tween types to certain Chart Editor events. ([5177e12](https://github.com/FunkinCrew/Funkin/commit/5177e1275eb2fb2b016224c139e84debb421b895)) - by @Lasercar in [#4249](https://github.com/FunkinCrew/Funkin/pull/4249) +- Added default gamepad controls for two recently added Freeplay controls. ([8dad4f5](https://github.com/FunkinCrew/Funkin/commit/8dad4f55b660a01d4e1a3a903fde684e9876f555)) - by @MrMadera in [#4559](https://github.com/FunkinCrew/Funkin/pull/4559) +- Added Perfect (Gold) to the list of available ranks in Results Debug menu. ([0261355](https://github.com/FunkinCrew/Funkin/commit/02613557787581b9c5b7532ea6e69001f1989102)) - by @AbnormalPoof in [#4642](https://github.com/FunkinCrew/Funkin/pull/4642) - Added a few sandboxed classes to give mods limited access to the Discord and Newgrounds APIs. ([6bd6066](https://github.com/FunkinCrew/Funkin/commit/6bd6066d169fd1611a706e984bb8d3ad7109e31f)) - by @KoloInDaCrib in [#5040](https://github.com/FunkinCrew/Funkin/pull/5040) -- Added the ability to open the Chart Editor for the currently selected song in Freeplay by pressing the Chart key. ([066c2d3](https://github.com/FunkinCrew/Funkin/commit/066c2d3db04162d3df6af883066fc91e05988d58)) - by @Lasercar in [#4114](https://github.com/FunkinCrew/Funkin/pull/4114) -- Added additional tween types to certain Chart Editor events. ([5177e12](https://github.com/FunkinCrew/Funkin/commit/5177e1275eb2fb2b016224c139e84debb421b895)) - by @Lasercar in [#4249](https://github.com/FunkinCrew/Funkin/pull/4249) -- Added "Flip character horizontally" to the list of shortcuts in the Animation Editor. ([f73e925](https://github.com/FunkinCrew/funkin.assets/commit/f73e925cbc1e99223095e444f9217839c7d8148e)) - by @AbnormalPoof in [#60](https://github.com/FunkinCrew/funkin.assets/pull/60) +- Pressing Ctrl + N now creates a new stage in the Stage Editor. ([bc54634](https://github.com/FunkinCrew/Funkin/commit/bc546345377f9e9e7b69306b72d494cad02ebaba)) - by @Lasercar in [#5175](https://github.com/FunkinCrew/Funkin/pull/5175) +- Added script support for Freeplay Backing Cards. ([92e7588](https://github.com/FunkinCrew/Funkin/commit/92e7588370fcbdc0e959e01e7e52eed5d62323f2)) - by @KoloInDaCrib in [#5233](https://github.com/FunkinCrew/Funkin/pull/5233) +- Added a variation indicator next to the Chart Editor playbar difficulty. ([dc7fa97](https://github.com/FunkinCrew/Funkin/commit/dc7fa97d3ca3c00edbab0adc171135af0008735d)) - by @KoloInDaCrib in [#5236](https://github.com/FunkinCrew/Funkin/pull/5236) +- Added "Flip character horizontally" to the list of shortcuts in the Animation Editor. ([f73e925](https://github.com/FunkinCrew/funkin.assets/commit/f73e925cbc1e99223095e444f9217839c7d8148e)) - by @AbnormalPoof in [funkin.assets#60](https://github.com/FunkinCrew/funkin.assets/pull/60) ### Changed - Modified several parts of the game to look better on phone screens with wider aspect ratios, up to 20:9. - Fixed a ton of performance issues to help the game run better on mobile devices. - Completely reformatted and optimized every single chart file in the game, along with fixing several chart issues. -- Notes now move based on delta timing, making them scroll smoother. ([6ad9ffc](https://github.com/FunkinCrew/Funkin/commit/6ad9ffc7f9d66bbaf6ba343663de4c7268f4be3b)) - by @KutikiPlayz in [#3544](https://github.com/FunkinCrew/Funkin/pull/3544) -- The Options Menu can now scroll to account for a lot of menu items. ([70f0a54](https://github.com/FunkinCrew/Funkin/commit/70f0a54191597bd72a6d30d4d12ef5ece6ba078c)) - by @AbnormalPoof in [#4706](https://github.com/FunkinCrew/Funkin/pull/4706) -- The Chart Editor will now load the first available difficulty when loading a song. ([19d75ff](https://github.com/FunkinCrew/Funkin/commit/19d75ffe72f08a6adb5b4ca00cae2f913767047a)) - by @Lasercar in [#4949](https://github.com/FunkinCrew/Funkin/pull/4949) -- Favorites in Freeplay are now sorted by week order instead of alphabetically. ([da0964a](https://github.com/FunkinCrew/Funkin/commit/da0964a7b7bbe4ece1bdbd19233eb6dba0de3ac5)) - by @Hundrec in [#3609](https://github.com/FunkinCrew/Funkin/pull/3609) -- The undo/redo history is now cleared when loading a new song in the Chart Editor. ([4c4045e](https://github.com/FunkinCrew/Funkin/commit/4c4045e274f6a7fa0bc2574468abb3b70ca68f00)) - by @Lasercar in [#4308](https://github.com/FunkinCrew/Funkin/pull/4308) -- The character select hint in Freeplay now always displays if you have more than 1 character unlocked. ([7ccf75c](https://github.com/FunkinCrew/Funkin/commit/7ccf75cd869ba4b6f18a5adc01e65e52ae7bb809)) - by @Hundrec in [#5023](https://github.com/FunkinCrew/Funkin/pull/5023) +- Completely reformatted every script file within the game's assets for better readability. +- Notes now scroll more smoothly by rendering based on delta timing. ([6ad9ffc](https://github.com/FunkinCrew/Funkin/commit/6ad9ffc7f9d66bbaf6ba343663de4c7268f4be3b)) - by @KutikiPlayz in [#3544](https://github.com/FunkinCrew/Funkin/pull/3544) +- Favorite songs in Freeplay are now sorted by Week order instead of alphabetically. ([da0964a](https://github.com/FunkinCrew/Funkin/commit/da0964a7b7bbe4ece1bdbd19233eb6dba0de3ac5)) - by @Hundrec in [#3609](https://github.com/FunkinCrew/Funkin/pull/3609) +- The Character Select screen now opens on the currently selected character. ([b233a53](https://github.com/FunkinCrew/Funkin/commit/b233a53710d8ef6b0151d83f5d78e1733fe356f5)) - by @Lasercar in [#4072](https://github.com/FunkinCrew/Funkin/pull/4072) +- The undo/redo history is now cleared when loading another song in the Chart Editor. ([4c4045e](https://github.com/FunkinCrew/Funkin/commit/4c4045e274f6a7fa0bc2574468abb3b70ca68f00)) - by @Lasercar in [#4308](https://github.com/FunkinCrew/Funkin/pull/4308) +- The Options Menu can now scroll to display more menu items. ([70f0a54](https://github.com/FunkinCrew/Funkin/commit/70f0a54191597bd72a6d30d4d12ef5ece6ba078c)) - by @AbnormalPoof in [#4706](https://github.com/FunkinCrew/Funkin/pull/4706) +- The Chart Editor will now only fall back to the first available difficulty if the selected difficulty cannot be found. ([19d75ff](https://github.com/FunkinCrew/Funkin/commit/19d75ffe72f08a6adb5b4ca00cae2f913767047a)) - by @Lasercar in [#4949](https://github.com/FunkinCrew/Funkin/pull/4949) +- Adjusted the size of the Beat/Step display in the Chart Editor. ([44b1a77](https://github.com/FunkinCrew/Funkin/commit/44b1a77b3b62146504166b392ea2dfbe6f65b302)) - by @NotHyper-474 in [#4994](https://github.com/FunkinCrew/Funkin/pull/4994) +- The Freeplay character select hint now always displays if you have more than one character unlocked. ([7ccf75c](https://github.com/FunkinCrew/Funkin/commit/7ccf75cd869ba4b6f18a5adc01e65e52ae7bb809)) - by @Hundrec in [#5023](https://github.com/FunkinCrew/Funkin/pull/5023) +- Raised the FPS cap preference from 300 to 500. ([71d7169](https://github.com/FunkinCrew/Funkin/commit/71d7169ba35c01471b4274671e238b0ac2cf04ed)) - by @Hundrec in [#5044](https://github.com/FunkinCrew/Funkin/pull/5044) - Blacklisted more classes for security reasons. ([cadfa3b](https://github.com/FunkinCrew/Funkin/commit/cadfa3b7ceae2ecabe2d544ddc4c9f453b0dfd56)) - by @NotHyper-474 in [#5185](https://github.com/FunkinCrew/Funkin/pull/5185) -- The FPS cap in the Options Menu has been raised from 300 to 500. ([71d7169](https://github.com/FunkinCrew/Funkin/commit/71d7169ba35c01471b4274671e238b0ac2cf04ed)) - by @Hundrec in [#5044](https://github.com/FunkinCrew/Funkin/pull/5044) -- Shifted Mommy Mearest's pixel icon to the left in Freeplay. ([d9e8085](https://github.com/FunkinCrew/funkin.assets/commit/d9e8085020cfc516b7c38ec7773081619ab840a4)) - by @KoloInDaCrib in [#197](https://github.com/FunkinCrew/funkin.assets/pull/197) +- Visualizers now zero out when the game audio is muted. ([3d205e9](https://github.com/FunkinCrew/Funkin/commit/3d205e935553096ab7bbd1879d8cb69bdb550ead)) - by @Lasercar in [#5266](https://github.com/FunkinCrew/Funkin/pull/5266) +- Shifted Mommy Mearest's pixel icon to the left in Freeplay. ([d9e8085](https://github.com/FunkinCrew/funkin.assets/commit/d9e8085020cfc516b7c38ec7773081619ab840a4)) - by @KoloInDaCrib in [funkin.assets#197](https://github.com/FunkinCrew/funkin.assets/pull/197) ### Fixed -- Fixed various issues with the Stage Editor. ([15083a4](https://github.com/FunkinCrew/Funkin/commit/15083a477626f67125bfd60a844b42b85a82d8c3)) - by @KoloInDaCrib in [#3974](https://github.com/FunkinCrew/Funkin/pull/3974) -- Fixed the "Load Metadata File" and "Load Chart File" buttons in the Chart Editor not doing anything. ([5eecef1](https://github.com/FunkinCrew/Funkin/commit/5eecef17a143cbc8cf2307bc29a20c96b8eed6a8)) - by @Lasercar in [#4278](https://github.com/FunkinCrew/Funkin/pull/4278) -- Fixed selection boxes duplicating in the Chart Editor. ([65ed583](https://github.com/FunkinCrew/Funkin/commit/65ed58350b798bca0044603510540cfe81b48611)) - by @NotHyper-474 in [#5073](https://github.com/FunkinCrew/Funkin/pull/5073) -- Removed a few spammy traces from the `DiscordClient` class. ([e89f9f5](https://github.com/FunkinCrew/Funkin/commit/e89f9f50dc6085e3550736459ce9e4fd02c1fc5b)) - by @AbnormalPoof in [#4207](https://github.com/FunkinCrew/Funkin/pull/4207) -- The Freeplay song capsules now cycle through long names more than once. ([ae086e7](https://github.com/FunkinCrew/Funkin/commit/ae086e7810437069efd3a4afbd55a5c303f473fb)) - by @VioletSnowLeopard in [#4677](https://github.com/FunkinCrew/Funkin/pull/4677) -- Fixed the Chart Editor not saving all audio preferences. ([6da2718](https://github.com/FunkinCrew/Funkin/commit/6da2718f116b45dd969ee74c808b86f63631984c)) - by @Lasercar in [#4149](https://github.com/FunkinCrew/Funkin/pull/4149) -- Fixed a few issues with the Countdown when restarting the song. ([63eca96](https://github.com/FunkinCrew/Funkin/commit/63eca96c98a87e7155df8b2a1735f269ea83e1b5)) - by @NotHyper-474 in [#4875](https://github.com/FunkinCrew/Funkin/pull/4875) -- The Gitaroo Man pause screen will now load the correct instrumental when restarting. ([a499f46](https://github.com/FunkinCrew/Funkin/commit/a499f46e6dcec301ab35e62b9e494c7fac2e9c9b)) - by @KoloInDaCrib in [#4956](https://github.com/FunkinCrew/Funkin/pull/4956) -- Hold note trails are now dragged alongside the note in the Chart Editor ([d3d8aaa](https://github.com/FunkinCrew/Funkin/commit/d3d8aaae7bfbfa8975a9573807b9a3ca68a1ff55)) - by @KoloInDaCrib in [#4127](https://github.com/FunkinCrew/Funkin/pull/4127) -- Fixed scores for Lit Up being impossible to submit to Newgrounds. ([183cec6](https://github.com/FunkinCrew/Funkin/commit/183cec62dc1fd3c7f3f634dd3e2400e6ee77b476)) - by @Raltryo in [#4577](https://github.com/FunkinCrew/Funkin/pull/4577) -- Fixed an issue where the cursor wouldn't be hidden if the game started unfocused. ([6222c38](https://github.com/FunkinCrew/Funkin/commit/6222c389e301fa2bb4939697376c4e51e29a9977)) - by @Hundrec in [#4520](https://github.com/FunkinCrew/Funkin/pull/4520) -- Fixed an issue where the song would skip after it starts if a high visual/audio offset is set. ([02c64ae](https://github.com/FunkinCrew/Funkin/commit/02c64aea9c2e7fe06f9116312d5ef6c049dc8e9c)) - by @xenkap in [#3732](https://github.com/FunkinCrew/Funkin/pull/3732) -- Girlfriend and Nene's combo drop animations now play if a note is completely missed or a hold note is dropped. ([34d5ed1](https://github.com/FunkinCrew/Funkin/commit/34d5ed11695cef7348c13505f13fb1da38b7988c)) - by @VioletSnowLeopard in [#4968](https://github.com/FunkinCrew/Funkin/pull/4968) -- Fixed a few visual issues with Freeplay's rank slam animation. ([ab817bb](https://github.com/FunkinCrew/Funkin/commit/ab817bb1eab74ae71c1b1fd74d7512a11e6d4339)) - by @Lasercar in [#4986](https://github.com/FunkinCrew/Funkin/pull/4986) -- Fixed a crash in the Chart Editor if a song's character didn't exist. ([3bbb4b0](https://github.com/FunkinCrew/Funkin/commit/3bbb4b06c8c1a1885a18d4354fcfa4363a0c6c75)) - by @Lasercar in [#5008](https://github.com/FunkinCrew/Funkin/pull/5008) -- Removed a spammy trace from Chart Editor song events. ([000491c](https://github.com/FunkinCrew/Funkin/commit/000491c3bd3db9de433a4b668b6ceebda2fc6eae)) - by @anysad in [#5097](https://github.com/FunkinCrew/Funkin/pull/5097) +- Songs no longer skip forward at the beginning with high visual offsets. ([02c64ae](https://github.com/FunkinCrew/Funkin/commit/02c64aea9c2e7fe06f9116312d5ef6c049dc8e9c)) - by @xenkap in [#3732](https://github.com/FunkinCrew/Funkin/pull/3732) +- Fixed various issues and added missing functionalities to the Stage Editor. ([15083a4](https://github.com/FunkinCrew/Funkin/commit/15083a477626f67125bfd60a844b42b85a82d8c3)) - by @KoloInDaCrib in [#3974](https://github.com/FunkinCrew/Funkin/pull/3974) +- Pressing the Chart Editor keybind during a song now opens to the variation and difficulty you were playing. ([aeb2dd5](https://github.com/FunkinCrew/Funkin/commit/aeb2dd53983b12fa0152861cc51a161115ea2729)) - by @Lasercar in [#4116](https://github.com/FunkinCrew/Funkin/pull/4116) +- Dragging a hold note in the Chart Editor now drags its trail along with its head. ([d3d8aaa](https://github.com/FunkinCrew/Funkin/commit/d3d8aaae7bfbfa8975a9573807b9a3ca68a1ff55)) - by @KoloInDaCrib in [#4127](https://github.com/FunkinCrew/Funkin/pull/4127) +- The help guide in the Stage Editor can no longer be opened multiple times. ([8c1fa3e](https://github.com/FunkinCrew/Funkin/commit/8c1fa3e630e595eac774e81f2c0f8f32ff97d927)) - by @Lasercar in [#4128](https://github.com/FunkinCrew/Funkin/pull/4128) +- The Chart Editor now properly saves audio levels when exiting. ([6da2718](https://github.com/FunkinCrew/Funkin/commit/6da2718f116b45dd969ee74c808b86f63631984c)) - by @Lasercar in [#4149](https://github.com/FunkinCrew/Funkin/pull/4149) +- Holding Ctrl and clicking on a hold note trail no longer crashes the Chart Editor. ([279bf2a](https://github.com/FunkinCrew/Funkin/commit/279bf2acd0e61b890a63b2dc4c82c6f6dc3c9ffd)) - by @Lasercar in [#4203](https://github.com/FunkinCrew/Funkin/pull/4203) +- Removed spammy console traces from `DiscordClient`. ([e89f9f5](https://github.com/FunkinCrew/Funkin/commit/e89f9f50dc6085e3550736459ce9e4fd02c1fc5b)) - by @AbnormalPoof in [#4207](https://github.com/FunkinCrew/Funkin/pull/4207) +- The Debug Menu can no longer be opened after selecting an item in the Main Menu. ([5695bc2](https://github.com/FunkinCrew/Funkin/commit/5695bc20e721f0afd5b97a36167f13e550c12b16)) - by @Lasercar in [#4211](https://github.com/FunkinCrew/Funkin/pull/4211) +- Fixed the Chart Editor timer occasionally displaying incorrect millisecond values. ([26dc895](https://github.com/FunkinCrew/Funkin/commit/26dc895a27e0d7e49469251cd68b83be66384e15)) - by @Hundrec in [#4257](https://github.com/FunkinCrew/Funkin/pull/4257) +- The Chart Editor "Load Metadata File" and "Load Chart File" buttons now function properly. ([5eecef1](https://github.com/FunkinCrew/Funkin/commit/5eecef17a143cbc8cf2307bc29a20c96b8eed6a8)) - by @Lasercar in [#4278](https://github.com/FunkinCrew/Funkin/pull/4278) +- The "New Highscore" text no longer appears more than once in the Results screen. ([c0d8e1b](https://github.com/FunkinCrew/Funkin/commit/c0d8e1b70356ec3492e57602a7d30fc2c595544b)) - by @Lasercar in [#4319](https://github.com/FunkinCrew/Funkin/pull/4319) +- The Story Mode Weekend 1 level title no longer clips into other level titles below it. ([b86efaa](https://github.com/FunkinCrew/Funkin/commit/b86efaaf7bc6b96fc3234b8f22420c2178fa4306)) - by @KoloInDaCrib in [#4348](https://github.com/FunkinCrew/Funkin/pull/4348) +- The debug cursor is now always hidden when the game starts. ([6222c38](https://github.com/FunkinCrew/Funkin/commit/6222c389e301fa2bb4939697376c4e51e29a9977)) - by @Hundrec in [#4520](https://github.com/FunkinCrew/Funkin/pull/4520) +- Fixed Newgrounds score submissions for Lit Up and Lit Up (BF Mix). ([183cec6](https://github.com/FunkinCrew/Funkin/commit/183cec62dc1fd3c7f3f634dd3e2400e6ee77b476)) - by @Raltyro in [#4577](https://github.com/FunkinCrew/Funkin/pull/4577) +- Freeplay song ranks no longer disappear after changing variations. ([c00f10a](https://github.com/FunkinCrew/Funkin/commit/c00f10adc8ebc7a6876bf20d6a4d15e44bb7d863)) - by @VioletSnowLeopard in [#4583](https://github.com/FunkinCrew/Funkin/pull/4583) +- Freeplay song capsules now cycle through long names consistently. ([ae086e7](https://github.com/FunkinCrew/Funkin/commit/ae086e7810437069efd3a4afbd55a5c303f473fb)) - by @VioletSnowLeopard in [#4677](https://github.com/FunkinCrew/Funkin/pull/4677) - Properly blacklist a certain class from scripts. ([3dc7699](https://github.com/FunkinCrew/Funkin/commit/3dc7699aac737998b637ff9a9f16986a434424be)) - by @charlesisfeline in [#4773](https://github.com/FunkinCrew/Funkin/pull/4773) -- Fixed the Chart Editor playbar being able to be dragged beyond the top of the window. ([03a0975](https://github.com/FunkinCrew/Funkin/commit/03a09752991c830be12befd5488fc8a102273c99)) - by @Hundrec in [#5024](https://github.com/FunkinCrew/Funkin/pull/5024) -- Fixed the Chart Editor playbar's width extending outside of the grid. ([7edc99b](https://github.com/FunkinCrew/Funkin/commit/7edc99b8ba7d1c61eba737560512a07babf5dfe8)) - by @anysad in [#5090](https://github.com/FunkinCrew/Funkin/pull/5090) -- Fixed the Chart Editor's millisecond display not being padded properly. ([26dc895](https://github.com/FunkinCrew/Funkin/commit/26dc895a27e0d7e49469251cd68b83be66384e15)) - by @Hundrec in [#4257](https://github.com/FunkinCrew/Funkin/pull/4257) -- Pressing the Chart key during a song now takes you to the variation you were on. ([aeb2dd5](https://github.com/FunkinCrew/Funkin/commit/aeb2dd53983b12fa0152861cc51a161115ea2729)) - by @Lasercar in [#4116](https://github.com/FunkinCrew/Funkin/pull/4116) -- Fixed a crash that could occur if you tried to open the Crash Log or Chart Editor Backups folder. ([60e2b88](https://github.com/FunkinCrew/Funkin/commit/60e2b88703678776994d7a038687773a1c639019)) - by @NotHyper-474 in [#4940](https://github.com/FunkinCrew/Funkin/pull/4940) -- Fixed a crash in the Chart Editor when pressing CTRL+Left Click on a hold note trail. ([279bf2a](https://github.com/FunkinCrew/Funkin/commit/279bf2acd0e61b890a63b2dc4c82c6f6dc3c9ffd)) - by @Lasercar in [#4203](https://github.com/FunkinCrew/Funkin/pull/4203) -- Fixed an issue where the Debug Menu could be opened after selecting a menu item in the Main Menu. ([5695bc2](https://github.com/FunkinCrew/Funkin/commit/5695bc20e721f0afd5b97a36167f13e550c12b16)) - by @Lasercar in [#4211](https://github.com/FunkinCrew/Funkin/pull/4211) -- Fixed an issue where the Stage Editor's help guide could be opened multiple times. ([8c1fa3e](https://github.com/FunkinCrew/Funkin/commit/8c1fa3e630e595eac774e81f2c0f8f32ff97d927)) - by @Lasercar in [#4128](https://github.com/FunkinCrew/Funkin/pull/4128) +- The song countdown no longer stacks when restarting or continues behind the Pause Menu. ([63eca96](https://github.com/FunkinCrew/Funkin/commit/63eca96c98a87e7155df8b2a1735f269ea83e1b5)) - by @NotHyper-474 in [#4875](https://github.com/FunkinCrew/Funkin/pull/4875) +- The charter field in the song metadata now properly displays the charter in the Chart Editor. ([4d24087](https://github.com/FunkinCrew/Funkin/commit/4d24087c2126f64f0bbdf32557e6f0ee7f2aee24)) - by @Lasercar in [#4879](https://github.com/FunkinCrew/Funkin/pull/4879) +- The Results Debug menu now shows the correct rank after recent scoring changes. ([66e36b9](https://github.com/FunkinCrew/Funkin/commit/66e36b99051298ddf306d981b3b0f29ddc88ffe3)) - by @NotHyper-474 in [#4905](https://github.com/FunkinCrew/Funkin/pull/4905) +- Opening the logs or backups folder before it's created no longer crashes the game. ([60e2b88](https://github.com/FunkinCrew/Funkin/commit/60e2b88703678776994d7a038687773a1c639019)) - by @NotHyper-474 in [#4940](https://github.com/FunkinCrew/Funkin/pull/4940) +- An easter egg now restarts the song using the correct instrumental. ([a499f46](https://github.com/FunkinCrew/Funkin/commit/a499f46e6dcec301ab35e62b9e494c7fac2e9c9b)) - by @KoloInDaCrib in [#4956](https://github.com/FunkinCrew/Funkin/pull/4956) +- Girlfriend's and Nene's combo drop animations now play consistently. ([34d5ed1](https://github.com/FunkinCrew/Funkin/commit/34d5ed11695cef7348c13505f13fb1da38b7988c)) - by @VioletSnowLeopard in [#4968](https://github.com/FunkinCrew/Funkin/pull/4968) +- Fixed a few visual issues with Freeplay's rank slam animation. ([ab817bb](https://github.com/FunkinCrew/Funkin/commit/ab817bb1eab74ae71c1b1fd74d7512a11e6d4339)) - by @Lasercar in [#4986](https://github.com/FunkinCrew/Funkin/pull/4986) +- Nonexistent characters no longer crash the Chart Editor. ([3bbb4b0](https://github.com/FunkinCrew/Funkin/commit/3bbb4b06c8c1a1885a18d4354fcfa4363a0c6c75)) - by @Lasercar in [#5008](https://github.com/FunkinCrew/Funkin/pull/5008) +- The Chart Editor playhead can no longer be scrolled to before the beginning of the song. ([03a0975](https://github.com/FunkinCrew/Funkin/commit/03a09752991c830be12befd5488fc8a102273c99)) - by @Hundrec in [#5024](https://github.com/FunkinCrew/Funkin/pull/5024) +- Fixed incorrect highlighting and squashed text on Freeplay song capsules. ([0c62428](https://github.com/FunkinCrew/Funkin/commit/0c62428fc883c0fa6d09cd403efb287ff3af8c53)) - by @VioletSnowLeopard in [#5036](https://github.com/FunkinCrew/Funkin/pull/5036) - Hot-reloading with F5 during gameplay no longer crashes the game. ([d2acb5d](https://github.com/FunkinCrew/Funkin/commit/d2acb5d167afd42299d7200ab8c67972044a09c6)) - by @AbnormalPoof in [#5065](https://github.com/FunkinCrew/Funkin/pull/5065) -- Fixed a crash when mashing D or I during startup. ([790af6d](https://github.com/FunkinCrew/Funkin/commit/790af6d9054a77248ecb7bf34d764186c4fa2243)) - by @CrusherNotDrip in [#5160](https://github.com/FunkinCrew/Funkin/pull/5160) -- Fixed two issues with song text on capsules in Freeplay. ([0c62428](https://github.com/FunkinCrew/Funkin/commit/0c62428fc883c0fa6d09cd403efb287ff3af8c53)) - by @VioletSnowLeopard in [#5036](https://github.com/FunkinCrew/Funkin/pull/5036) +- Fixed selection boxes duplicating in the Chart Editor. ([65ed583](https://github.com/FunkinCrew/Funkin/commit/65ed58350b798bca0044603510540cfe81b48611)) - by @NotHyper-474 in [#5073](https://github.com/FunkinCrew/Funkin/pull/5073) - Hot-reloading with F5 in the Input Offsets menu no longer crashes the game. ([22372e8](https://github.com/FunkinCrew/Funkin/commit/22372e83886c5ef9821228daa3fb9fe8fbcf0e07)) - by @NotHyper-474 in [#5085](https://github.com/FunkinCrew/Funkin/pull/5085) -- Fixed Girlfriend (Tankman Stickup) not playing her combo drop animation. ([cb0e506](https://github.com/FunkinCrew/funkin.assets/commit/cb0e506599d387b1d17faee2cf319914eb2dfc80)) - by @qt2k4 in [#149](https://github.com/FunkinCrew/funkin.assets/pull/149) -- Changed "Tankman Battlefield (Erect)" to "Tankman Battlefield [Erect]" for consistency. ([f9149eb](https://github.com/FunkinCrew/funkin.assets/commit/f9149eb72698ddd275f743080effed08c842644e)) - by @JVN-Pixels in [#155](https://github.com/FunkinCrew/funkin.assets/pull/155) -- Fixed Pico (Pixel) having the incorrect name in the Chart Editor. ([a668659](https://github.com/FunkinCrew/funkin.assets/commit/a668659a4bbd2094fde48041c73fd1ebef551288)) - by @ExtraCode75 in [#158](https://github.com/FunkinCrew/funkin.assets/pull/158) -- Fixed an issue where vocals were present in the instrumental for Monster on web builds. ([bf7b032](https://github.com/FunkinCrew/funkin.assets/commit/bf7b032154fdc9751fbe8fdf88dbc5fd24f361db)) - by @JVN-Pixels in [#182](https://github.com/FunkinCrew/funkin.assets/pull/182) -- Pico now gasps only once in the doppelganger cutscene in Week 3 Pico Mixes. ([ecda30d](https://github.com/FunkinCrew/funkin.assets/commit/ecda30d7532df3c34a4b5ad25579cc960cb30c0f)) - by @KoloInDaCrib in [#126](https://github.com/FunkinCrew/funkin.assets/pull/126) -- Adjusted offsets for one of Freeplay DJ Pico's animations. ([17996db](https://github.com/FunkinCrew/funkin.assets/commit/17996db752c3077e005d4f05286a7795746acb05)) - by @AbnormalPoof in [#91](https://github.com/FunkinCrew/funkin.assets/pull/91) -- Fixed a crash in the Chart Editor if you get Boyfriend's fakeout death animation while playtesting. ([6cf9fb7](https://github.com/FunkinCrew/funkin.assets/commit/6cf9fb7ba48bb336f63eb940290fa051859330ec)) - by @NotHyper-474 in [#133](https://github.com/FunkinCrew/funkin.assets/pull/133) -- Fixed an issue where Darnell (BF Mix)'s instrumental was inaccessible. ([7bf4361](https://github.com/FunkinCrew/funkin.assets/commit/7bf436153081c27fdb354eddb05b72bd87fb18b7)) - by @Hundrec in [#168](https://github.com/FunkinCrew/funkin.assets/pull/168) -- Fixed an issue where one of Darnell's animations didn't play in 2hot. ([f8030c4](https://github.com/FunkinCrew/funkin.assets/commit/f8030c441c73d203f7b92c243542f99402faf2a7)) - by @biomseed in [#78](https://github.com/FunkinCrew/funkin.assets/pull/78) -- Adjusted the font size for Starting BPM in the Chart Editor to be more consistent. ([801121a](https://github.com/FunkinCrew/funkin.assets/commit/801121a7d31ef3a1ac108bf16941d88009d1b12a)) - by @Lasercar in [#170](https://github.com/FunkinCrew/funkin.assets/pull/170) -- Fixed an issue where A-Bot's visualizer would jump to a random volume when the song ends. ([2904697](https://github.com/FunkinCrew/funkin.assets/commit/2904697b6fda66db4df2b47127f05520fdf831d1)) - by @VioletSnowLeopard in [#183](https://github.com/FunkinCrew/funkin.assets/pull/183) -- Fixed an issue where one of Pico's animations in South (Pico Mix) would play mute if you missed a note prior to the animation playing. ([2bf3846](https://github.com/FunkinCrew/funkin.assets/commit/2bf38463c524839e85faec19b7f31e90070e0b87)) - by @Hundrec in [#71](https://github.com/FunkinCrew/funkin.assets/pull/71) -- Fixed an issue where the close button would be momentarily hidden in windows in the Chart or Stage editors. ([929f61f](https://github.com/FunkinCrew/funkin.assets/commit/929f61fe86bd49d61de27e09503085a04c2cddfb)) - by @Lasercar in [#121](https://github.com/FunkinCrew/funkin.assets/pull/121) -- Otis and Pico (Speaker) no longer spaz out when playtesting Stress. ([2fd62d8](https://github.com/FunkinCrew/funkin.assets/commit/2fd62d8f4fdefffc8d4a9cc96b9e993fd0130eb4)) - by @Lasercar in [#124](https://github.com/FunkinCrew/funkin.assets/pull/124) -- Removed a spammy trace in the script for Spooky Kids (Dark). ([9ee98d6](https://github.com/FunkinCrew/funkin.assets/commit/9ee98d62aa336f1fccbefaf077b4ae3222e00ec4)) - by @NotHyper-474 in [#187](https://github.com/FunkinCrew/funkin.assets/pull/187) +- The Chart Editor playbar no longer extends past the right of the grid. ([7edc99b](https://github.com/FunkinCrew/Funkin/commit/7edc99b8ba7d1c61eba737560512a07babf5dfe8)) - by @anysad in [#5090](https://github.com/FunkinCrew/Funkin/pull/5090) +- Removed a spammy console trace from some Chart Editor events. ([000491c](https://github.com/FunkinCrew/Funkin/commit/000491c3bd3db9de433a4b668b6ceebda2fc6eae)) - by @anysad in [#5097](https://github.com/FunkinCrew/Funkin/pull/5097) +- Fixed a crash when mashing D or I during startup. ([790af6d](https://github.com/FunkinCrew/Funkin/commit/790af6d9054a77248ecb7bf34d764186c4fa2243)) - by @CrusherNotDrip in [#5160](https://github.com/FunkinCrew/Funkin/pull/5160) +- The Chart Editor now consistently displays the correct waveform for vocal tracks. ([788d0fe](https://github.com/FunkinCrew/Funkin/commit/788d0fe9be5754e4e193de56e4437e8f409564a2)) - by @NotHyper-474 in [#5231](https://github.com/FunkinCrew/Funkin/pull/5231) +- Stage Editor windows are now able to be closed. ([990042e](https://github.com/FunkinCrew/Funkin/commit/990042e28f73ad0624dfd38179891163d0c2313a)) - by @Lasercar in [#5238](https://github.com/FunkinCrew/Funkin/pull/5238) +- Fixed duplicate exit prompts appearing in the Stage Editor. ([a599d83](https://github.com/FunkinCrew/Funkin/commit/a599d830f08ba697f2b526747280a53e16ebae06)) - by @Lasercar in [#5239](https://github.com/FunkinCrew/Funkin/pull/5239) +- Reduced the severity of a memory leak in the Chart Editor. ([6ec3191](https://github.com/FunkinCrew/Funkin/commit/6ec3191b2952533afeded514d582a56f0905afb8)) - by @NotHyper-474 in [#5247](https://github.com/FunkinCrew/Funkin/pull/5247) +- The Freeplay song preview no longer plays twice after returning from Character Select. ([f9387c1](https://github.com/FunkinCrew/Funkin/commit/f9387c144a62ecae2ea2b9da7b93ee16693bff02)) - by @Lasercar in [#5248](https://github.com/FunkinCrew/Funkin/pull/5248) +- Undoing and redoing hold note length changes now visually updates the trail in the Chart Editor. ([254be57](https://github.com/FunkinCrew/Funkin/commit/254be5798ec0b7b2e79612ae5ade438965e65249)) - by @NotHyper-474 in [#5265](https://github.com/FunkinCrew/Funkin/pull/5265) +- Pico's burpShit animation now re-enables volume for player vocals. ([2bf3846](https://github.com/FunkinCrew/funkin.assets/commit/2bf38463c524839e85faec19b7f31e90070e0b87)) - by @Hundrec in [funkin.assets#71](https://github.com/FunkinCrew/funkin.assets/pull/71) +- Darnell's kneeCan animation now plays properly in 2hot. ([f8030c4](https://github.com/FunkinCrew/funkin.assets/commit/f8030c441c73d203f7b92c243542f99402faf2a7)) - by @biomseed in [funkin.assets#78](https://github.com/FunkinCrew/funkin.assets/pull/78) +- Adjusted offsets for Freeplay DJ Pico's fistPump animation. ([17996db](https://github.com/FunkinCrew/funkin.assets/commit/17996db752c3077e005d4f05286a7795746acb05)) - by @AbnormalPoof in [funkin.assets#91](https://github.com/FunkinCrew/funkin.assets/pull/91) +- Chart Editor and Stage Editor windows now consistently show a close button. ([929f61f](https://github.com/FunkinCrew/funkin.assets/commit/929f61fe86bd49d61de27e09503085a04c2cddfb)) - by @Lasercar in [funkin.assets#121](https://github.com/FunkinCrew/funkin.assets/pull/121) +- Otis and Pico (Speaker) no longer spaz out when playtesting Stress. ([2fd62d8](https://github.com/FunkinCrew/funkin.assets/commit/2fd62d8f4fdefffc8d4a9cc96b9e993fd0130eb4)) - by @Lasercar in [funkin.assets#124](https://github.com/FunkinCrew/funkin.assets/pull/124) +- The gasp sound now only plays once in the Week 3 Pico Mix doppelganger cutscene. ([ecda30d](https://github.com/FunkinCrew/funkin.assets/commit/ecda30d7532df3c34a4b5ad25579cc960cb30c0f)) - by @KoloInDaCrib in [funkin.assets#126](https://github.com/FunkinCrew/funkin.assets/pull/126) +- Encountering an easter egg during a Chart Editor playtest no longer crashes the game. ([6cf9fb7](https://github.com/FunkinCrew/funkin.assets/commit/6cf9fb7ba48bb336f63eb940290fa051859330ec)) - by @NotHyper-474 in [funkin.assets#133](https://github.com/FunkinCrew/funkin.assets/pull/133) +- Girlfriend (Tankman Stickup) now plays her combo drop animation. ([cb0e506](https://github.com/FunkinCrew/funkin.assets/commit/cb0e506599d387b1d17faee2cf319914eb2dfc80)) - by @qt2k4 in [funkin.assets#149](https://github.com/FunkinCrew/funkin.assets/pull/149) +- Changed "Tankman Battlefield (Erect)" to "Tankman Battlefield [Erect]" in the Chart Editor for consistency. ([f9149eb](https://github.com/FunkinCrew/funkin.assets/commit/f9149eb72698ddd275f743080effed08c842644e)) - by @JVN-Pixels in [funkin.assets#155](https://github.com/FunkinCrew/funkin.assets/pull/155) +- Fixed Pico (Pixel) having the incorrect name in the Chart Editor. ([a668659](https://github.com/FunkinCrew/funkin.assets/commit/a668659a4bbd2094fde48041c73fd1ebef551288)) - by @ExtraCode75 in [funkin.assets#158](https://github.com/FunkinCrew/funkin.assets/pull/158) +- Darnell (BF Mix)'s alternate instrumental is now properly accessible. ([7bf4361](https://github.com/FunkinCrew/funkin.assets/commit/7bf436153081c27fdb354eddb05b72bd87fb18b7)) - by @Hundrec in [funkin.assets#168](https://github.com/FunkinCrew/funkin.assets/pull/168) +- Adjusted the font size for Starting BPM in the Chart Editor for consistency. ([801121a](https://github.com/FunkinCrew/funkin.assets/commit/801121a7d31ef3a1ac108bf16941d88009d1b12a)) - by @Lasercar in [funkin.assets#170](https://github.com/FunkinCrew/funkin.assets/pull/170) +- Removed vocals from Monster's instrumental on web builds. ([bf7b032](https://github.com/FunkinCrew/funkin.assets/commit/bf7b032154fdc9751fbe8fdf88dbc5fd24f361db)) - by @JVN-Pixels in [funkin.assets#182](https://github.com/FunkinCrew/funkin.assets/pull/182) +- A-Bot's visualizer no longer jumps to a random volume when the song ends. ([2904697](https://github.com/FunkinCrew/funkin.assets/commit/2904697b6fda66db4df2b47127f05520fdf831d1)) - by @VioletSnowLeopard in [funkin.assets#183](https://github.com/FunkinCrew/funkin.assets/pull/183) +- The cars in Week 4 and Weekend 1 no longer get stuck when the song is restarted. ([ecb1bbd](https://github.com/FunkinCrew/funkin.assets/commit/ecb1bbd8c8ced028b96b2c9b5572d2ea48f36cf4)) - by @MetaBreeze in [funkin.assets#186](https://github.com/FunkinCrew/funkin.assets/pull/186) +- Removed a spammy console trace from Spooky Kids (Dark). ([9ee98d6](https://github.com/FunkinCrew/funkin.assets/commit/9ee98d62aa336f1fccbefaf077b4ae3222e00ec4)) - by @NotHyper-474 in [funkin.assets#187](https://github.com/FunkinCrew/funkin.assets/pull/187) ### Removed - [MOBILE] The Input Offsets menu has been temporarily removed pending future reworks. -- The VSync option has been removed from web builds as it's non-functional. ([1338834](https://github.com/FunkinCrew/Funkin/commit/1338834519e13326fa21585a236218cd984ed614)) - by @NotHyper-474 in [#5062](https://github.com/FunkinCrew/Funkin/pull/5062) -- Removed a few non-functional options related to screenshots. ([8e40942](https://github.com/FunkinCrew/Funkin/commit/8e4094227f89ccc8ec7e58be49a5e1ad6911ed12)) - by @Lasercar in [#4895](https://github.com/FunkinCrew/Funkin/pull/4895) +- Removed a few non-functional screenshot preferences. ([8e40942](https://github.com/FunkinCrew/Funkin/commit/8e4094227f89ccc8ec7e58be49a5e1ad6911ed12)) - by @Lasercar in [#4895](https://github.com/FunkinCrew/Funkin/pull/4895) +- Removed the VSync preference from web builds, where it's non-functional. ([1338834](https://github.com/FunkinCrew/Funkin/commit/1338834519e13326fa21585a236218cd984ed614)) - by @NotHyper-474 in [#5062](https://github.com/FunkinCrew/Funkin/pull/5062) ## New Contributors for 0.7.0 * @KutikiPlayz made their first contribution in [#3544](https://github.com/FunkinCrew/Funkin/pull/3544) -* @Raltryo made their first contribution in [#4577](https://github.com/FunkinCrew/Funkin/pull/4577) * @xenkap made their first contribution in [#3732](https://github.com/FunkinCrew/Funkin/pull/3732) -* @charlesisfeline made their first contribution in [#4773](https://github.com/FunkinCrew/Funkin/pull/4773) -* @qt2k4 made their first contribution in [#149](https://github.com/FunkinCrew/funkin.assets/pull/149) -* @ExtraCode75 made their first contribution in [#158](https://github.com/FunkinCrew/funkin.assets/pull/158) -* @biomseed made their first contribution in [#78](https://github.com/FunkinCrew/funkin.assets/pull/78) +* @Raltyro made their first contribution in [#4577](https://github.com/FunkinCrew/Funkin/pull/4577) +* @biomseed made their first contribution in [funkin.assets#78](https://github.com/FunkinCrew/funkin.assets/pull/78) +* @qt2k4 made their first contribution in [funkin.assets#149](https://github.com/FunkinCrew/funkin.assets/pull/149) +* @ExtraCode75 made their first contribution in [funkin.assets#158](https://github.com/FunkinCrew/funkin.assets/pull/158) +* @MetaBreeze made their first contribution in [funkin.assets#186](https://github.com/FunkinCrew/funkin.assets/pull/186) diff --git a/assets b/assets index 6d513ccf7..8c1fe1619 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 6d513ccf7d5bcaaba11534a57cc1fee0577e4b61 +Subproject commit 8c1fe161958a7b14cea1b84e0d342f15b342731e diff --git a/compression-excludes.txt b/compression-excludes.txt index e0a9c8bfe..4b80d239b 100644 --- a/compression-excludes.txt +++ b/compression-excludes.txt @@ -1,6 +1,8 @@ assets/preload/images/cursor/* assets/preload/images/freeplay/* assets/preload/images/icons/* +assets/preload/images/titleEnter.png +assets/preload/images/titleEnter_mobile.png assets/preload/images/soundtray/* assets/preload/images/stageBuild/* assets/preload/images/ui/popup/pixel/ diff --git a/hmm.json b/hmm.json index 049e1d67c..50c9a7e24 100644 --- a/hmm.json +++ b/hmm.json @@ -55,13 +55,6 @@ "ref": "b9118f47f43a66bc0e5fbfcfd9903f0425e918ee", "url": "https://github.com/FunkinCrew/flixel-addons" }, - { - "name": "flixel-text-input", - "type": "git", - "dir": null, - "ref": "951a0103a17bfa55eed86703ce50b4fb0d7590bc", - "url": "https://github.com/FunkinCrew/flixel-text-input" - }, { "name": "flxanimate", "type": "git", @@ -85,7 +78,7 @@ "name": "grig.audio", "type": "git", "dir": "src", - "ref": "bcfc273ca6d52827bc5b1d910115ce212b50b76b", + "ref": "8567c4dad34cfeaf2ff23fe12c3796f5db80685e", "url": "https://github.com/FunkinCrew/grig.audio" }, { @@ -97,14 +90,14 @@ "name": "haxeui-core", "type": "git", "dir": null, - "ref": "07fc7aa8098deaea633b0726d01f83eb4ef8a832", + "ref": "47ee9f5fa02d422e186e844f87e68220cabfcc5b", "url": "https://github.com/haxeui/haxeui-core" }, { "name": "haxeui-flixel", "type": "git", "dir": null, - "ref": "b899a4c7d7318c5ff2b1bb645fbc73728fad1ac9", + "ref": "100f2c96beab619cfe72c567a058c41c71e3e998", "url": "https://github.com/haxeui/haxeui-flixel" }, { @@ -118,7 +111,7 @@ "name": "hxcpp", "type": "git", "dir": null, - "ref": "d5d9bd200e509f2e6022c8999c91543a0fda30c6", + "ref": "4e24283a047f11bded6affabbc9ec405156e026e", "url": "https://github.com/FunkinCrew/hxcpp" }, { @@ -177,7 +170,7 @@ "name": "lime", "type": "git", "dir": null, - "ref": "295d9458d59bae9556a16724634a5a99f9fc3cf5", + "ref": "045ede0363120ff0425529a4902e4da44fd6d293", "url": "https://github.com/FunkinCrew/lime-mobile" }, { diff --git a/project.hxp b/project.hxp index e71d8368c..55530bfcf 100644 --- a/project.hxp +++ b/project.hxp @@ -263,15 +263,15 @@ class Project extends HXProject /** * `-DFEATURE_COMPRESSED_TEXTURES` * If this flag is enabled, ASTC compressed textures will be used over uncompressed PNGs. - * Compressed ASTC textures provide lower memory usage but at the cost of a higher files size. + * Compressed ASTC textures provide lower memory usage but at the cost of a slightly higher files size & more GPU usage. * ASTC textures are GPU Rendered so they have a few cons: - * - Pixel Data cannot be read directly. + * - Pixel Data of bitmaps cannot be read nor edited directly. * - Some filters specifically the ones in openfl.filters package won't work properly because they directly modify the bitmap pixels. - * - ASync loading for GPU Textures seem bugged and results in a black texture (This is meant to be fixed soon because it's not supposed to happen.). + * - ASync loading for GPU Compressed Textures doesn't work due to OpenGL being single-threaded. (Looking online there seem to be some workarounds but it's pretty complicated...). * One thing to note is that ASTC textures aren't available on all platforms: - * - For iOS it's available starting from phones with A8 chips, so anything from iPhone 6 and beyond has it. - * - For Android it's sorta mixed, but mostly any mid range phone from around 2018 does support ASTC. - * - For desktop it really all just depends on the GPU, but Windows with DirectX 12 should have supported. + * - For iOS, it's available starting from phones with A8 chips, so anything from iPhone 6 and beyond has it. + * - For Android, it's sorta mixed, but mostly any mid range phone that came after 2017 does support ASTC. + * - For desktop, it appears to be only supported on Intergrated Graphics from our testing. */ static final FEATURE_COMPRESSED_TEXTURES:FeatureFlag = "FEATURE_COMPRESSED_TEXTURES"; @@ -843,6 +843,11 @@ class Project extends HXProject // Essential on mobile but delayed on desktop. // Please send targeted harassment to PhantomArcade about this. FEATURE_GHOST_TAPPING.apply(this, isMobile()); + + // Enable ASTC Compressed textures for mobile. + // Since mobile is pretty memory safe (I'm looking at you Apple...) we need them BADLY to have the game run properly. + // It's kept off for desktop due to the low ASTC support on desktop GPUs (which seem to be only among Intergrated Graphics). + FEATURE_COMPRESSED_TEXTURES.apply(this, isMobile() && isRelease()); } /** @@ -1030,7 +1035,6 @@ class Project extends HXProject // addHaxelib('flixel-ui'); // UI framework (DEPRECATED) addHaxelib('haxeui-core'); // UI framework addHaxelib('haxeui-flixel'); // Integrate HaxeUI with Flixel - addHaxelib('flixel-text-input'); // Improved text field rendering for HaxeUI addHaxelib('polymod'); // Modding framework addHaxelib('flxanimate'); // Texture atlas rendering diff --git a/source/cpp/vm/tracy/TracyProfiler.hx b/source/cpp/vm/tracy/TracyProfiler.hx index 1bedd521d..e25e5ea5e 100644 --- a/source/cpp/vm/tracy/TracyProfiler.hx +++ b/source/cpp/vm/tracy/TracyProfiler.hx @@ -24,6 +24,27 @@ extern class Native_TracyProfiler @:native('::__hxcpp_tracy_framemark') public static function frameMark():Void; + /** + Mark a named frame. Allows creating multiple frame sets for different timing categories. + Each unique name creates a separate frame set in the Tracy timeline. + **/ + @:native('::__hxcpp_tracy_framemark_named') + public static function frameMarkNamed(_name:String):Void; + + /** + Mark the start of a discontinuous frame. Use for periodic work with gaps. + Must be paired with frameMarkEnd() using the same name. + **/ + @:native('::__hxcpp_tracy_framemark_start') + public static function frameMarkStart(_name:String):Void; + + /** + Mark the end of a discontinuous frame. Use for periodic work with gaps. + Must be paired with frameMarkStart() using the same name. + **/ + @:native('::__hxcpp_tracy_framemark_end') + public static function frameMarkEnd(_name:String):Void; + /** Print a message into Tracy's log. **/ @@ -71,6 +92,18 @@ class Cppia_TracyProfiler public static function frameMark() Native_TracyProfiler.frameMark(); + @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.frameMarkNamed) + public static function frameMarkNamed(_name:String) + Native_TracyProfiler.frameMarkNamed(_name); + + @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.frameMarkStart) + public static function frameMarkStart(_name:String) + Native_TracyProfiler.frameMarkStart(_name); + + @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.frameMarkEnd) + public static function frameMarkEnd(_name:String) + Native_TracyProfiler.frameMarkEnd(_name); + @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.message) public static function message(_msg:String, ?_color:Int = 0x000000) Native_TracyProfiler.message(_msg, _color); diff --git a/source/funkin/audio/visualize/ABotVis.hx b/source/funkin/audio/visualize/ABotVis.hx index 81b883463..f25e7b0b0 100644 --- a/source/funkin/audio/visualize/ABotVis.hx +++ b/source/funkin/audio/visualize/ABotVis.hx @@ -116,7 +116,7 @@ class ABotVis extends FlxTypedSpriteGroup for (i in 0...min(group.members.length, levels.length)) { - var animFrame:Int = Math.round(levels[i].value * 6); + var animFrame:Int = (FlxG.sound.volume == 0 || FlxG.sound.muted) ? 0 : Math.round(levels[i].value * 6); // don't display if we're at 0 volume from the level group.members[i].visible = animFrame > 0; diff --git a/source/funkin/data/BaseRegistry.hx b/source/funkin/data/BaseRegistry.hx index dad238478..38c4e03f9 100644 --- a/source/funkin/data/BaseRegistry.hx +++ b/source/funkin/data/BaseRegistry.hx @@ -15,6 +15,7 @@ typedef EntryConstructorFunction = String->Void; * @param T The type to construct. Must implement `IRegistryEntry`. * @param J The type of the JSON data used when constructing. */ +@:nullSafety @:generic @:autoBuild(funkin.util.macro.DataRegistryMacro.buildRegistry()) abstract class BaseRegistry & Constructible), J> @@ -115,7 +116,7 @@ abstract class BaseRegistry & Constructible = createEntry(entryId); if (entry != null) { trace(' Loaded entry data: ${entry}'); @@ -165,7 +166,7 @@ abstract class BaseRegistry & Constructible { return scriptedEntryIds.get(id); } @@ -216,7 +217,7 @@ abstract class BaseRegistry & Constructible { var entryStr:String = loadEntryFile(id).contents; - var entryVersion:thx.semver.Version = VersionUtil.getVersionFromJSON(entryStr); + var entryVersion:Null = VersionUtil.getVersionFromJSON(entryStr); return entryVersion; } diff --git a/source/funkin/data/DataParse.hx b/source/funkin/data/DataParse.hx index 472ffd6e7..42d37b36f 100644 --- a/source/funkin/data/DataParse.hx +++ b/source/funkin/data/DataParse.hx @@ -19,6 +19,7 @@ import thx.semver.VersionRule; * * Functions must be of the signature `(hxjsonast.Json, String) -> T`, where the String is the property name and `T` is the type of the property. */ +@:nullSafety class DataParse { /** @@ -146,7 +147,6 @@ class DataParse throw 'Expected Backdrop property $name to be specify a valid "type", but it was "${backdropType}".'; } - return null; default: throw 'Expected property $name to be an object, but it was ${json.value}.'; } @@ -310,6 +310,7 @@ class DataParse var length:Null = values[2] == null ? null : Tools.getValue(values[2]); var alt:Null = values[3] == null ? null : Tools.getValue(values[3]); + if (time == null || data == null) throw 'Property $name note is missing time and/or data values.'; return new LegacyNote(time, data, length, alt); // return null; default: diff --git a/source/funkin/data/animation/AnimationData.hx b/source/funkin/data/animation/AnimationData.hx index 8f977219a..cdc8cc826 100644 --- a/source/funkin/data/animation/AnimationData.hx +++ b/source/funkin/data/animation/AnimationData.hx @@ -1,8 +1,9 @@ package funkin.data.animation; +@:nullSafety class AnimationDataUtil { - public static function toNamed(data:UnnamedAnimationData, ?name:String = ""):AnimationData + public static function toNamed(data:UnnamedAnimationData, name:String = ""):AnimationData { return { name: name, @@ -22,7 +23,7 @@ class AnimationDataUtil * @param name (adds index to name) * @return Array */ - public static function toNamedArray(data:Array, ?name:String = ""):Array + public static function toNamedArray(data:Array, name:String = ""):Array { return data.mapi(function(animItem, ind) return toNamed(animItem, '$name$ind')); } diff --git a/source/funkin/data/event/SongEventRegistry.hx b/source/funkin/data/event/SongEventRegistry.hx index 772465cf2..33b86ec56 100644 --- a/source/funkin/data/event/SongEventRegistry.hx +++ b/source/funkin/data/event/SongEventRegistry.hx @@ -8,6 +8,7 @@ import funkin.play.event.ScriptedSongEvent; /** * This class statically handles the parsing of internal and scripted song event handlers. */ +@:nullSafety class SongEventRegistry { /** @@ -87,14 +88,14 @@ class SongEventRegistry return eventCache.values(); } - public static function getEvent(id:String):SongEvent + public static function getEvent(id:String):Null { return eventCache.get(id); } - public static function getEventSchema(id:String):SongEventSchema + public static function getEventSchema(id:String):Null { - var event:SongEvent = getEvent(id); + var event:Null = getEvent(id); if (event == null) return null; return event.getEventSchema(); @@ -108,7 +109,7 @@ class SongEventRegistry public static function handleEvent(data:SongEventData):Void { var eventKind:String = data.eventKind; - var eventHandler:SongEvent = eventCache.get(eventKind); + var eventHandler:Null = eventCache.get(eventKind); if (eventHandler != null) { diff --git a/source/funkin/data/freeplay/player/PlayerRegistry.hx b/source/funkin/data/freeplay/player/PlayerRegistry.hx index b87bfe11b..e40bedf1c 100644 --- a/source/funkin/data/freeplay/player/PlayerRegistry.hx +++ b/source/funkin/data/freeplay/player/PlayerRegistry.hx @@ -125,16 +125,13 @@ class PlayerRegistry extends BaseRegistry impleme /** * Return true if the given stage character is associated with a specific playable character. * If so, the level should only appear if that character is selected in Freeplay. + * NOTE: This is NOT THE SAME as `player.isUnlocked()`! * @param characterId The stage character ID. * @return Whether the character is owned by any one character. */ public function isCharacterOwned(characterId:String):Bool { - #if UNLOCK_EVERYTHING - return true; - #else return ownedCharacterIds.exists(characterId); - #end } /** diff --git a/source/funkin/data/notestyle/NoteStyleRegistry.hx b/source/funkin/data/notestyle/NoteStyleRegistry.hx index c88aba6d5..6a761d1aa 100644 --- a/source/funkin/data/notestyle/NoteStyleRegistry.hx +++ b/source/funkin/data/notestyle/NoteStyleRegistry.hx @@ -6,6 +6,7 @@ import funkin.data.notestyle.NoteStyleData; import funkin.util.tools.ISingleton; import funkin.data.DefaultRegistryImpl; +@:nullSafety class NoteStyleRegistry extends BaseRegistry implements ISingleton implements DefaultRegistryImpl { /** @@ -24,6 +25,8 @@ class NoteStyleRegistry extends BaseRegistry implement public function fetchDefault():NoteStyle { - return fetchEntry(Constants.DEFAULT_NOTE_STYLE); + var notestyle:Null = fetchEntry(Constants.DEFAULT_NOTE_STYLE); + if (notestyle == null) throw 'Default notestyle was null! This should not happen!'; + return notestyle; } } diff --git a/source/funkin/data/song/SongData.hx b/source/funkin/data/song/SongData.hx index b5da02d00..136c728a9 100644 --- a/source/funkin/data/song/SongData.hx +++ b/source/funkin/data/song/SongData.hx @@ -68,11 +68,12 @@ class SongMetadata implements ICloneable @:jignored public var variation:String; - public function new(songName:String, artist:String, ?variation:String) + public function new(songName:String, artist:String, ?charter:String, ?variation:String) { this.version = SongRegistry.SONG_METADATA_VERSION; this.songName = songName; this.artist = artist; + this.charter = (charter == null) ? null : charter; this.timeFormat = 'ms'; this.divisions = null; this.offsets = new SongOffsets(); @@ -96,7 +97,7 @@ class SongMetadata implements ICloneable */ public function clone():SongMetadata { - var result:SongMetadata = new SongMetadata(this.songName, this.artist, this.variation); + var result:SongMetadata = new SongMetadata(this.songName, this.artist, this.charter, this.variation); result.version = this.version; result.timeFormat = this.timeFormat; result.divisions = this.divisions; @@ -139,7 +140,7 @@ class SongMetadata implements ICloneable */ public function toString():String { - return 'SongMetadata(${this.songName} by ${this.artist}, variation ${this.variation})'; + return 'SongMetadata(${this.songName} by ${this.artist}, charted by ${this.charter}, variation ${this.variation})'; } } diff --git a/source/funkin/data/song/SongDataUtils.hx b/source/funkin/data/song/SongDataUtils.hx index 1445864a7..d1b16e3d1 100644 --- a/source/funkin/data/song/SongDataUtils.hx +++ b/source/funkin/data/song/SongDataUtils.hx @@ -11,6 +11,7 @@ using Lambda; /** * Utility functions for working with song data, including note data, event data, metadata, etc. */ +@:nullSafety class SongDataUtils { /** @@ -27,7 +28,7 @@ class SongDataUtils var time:Float = note.time + offset; var data:Int = note.data; var length:Float = note.length; - var kind:String = note.kind; + var kind:Null = note.kind; return new SongNoteData(time, data, length, kind); }; @@ -131,7 +132,7 @@ class SongDataUtils * Create an array of notes whose note data is flipped (player becomes opponent and vice versa) * Does not mutate the original array. */ - public static function flipNotes(notes:Array, ?strumlineSize:Int = 4):Array + public static function flipNotes(notes:Array, strumlineSize:Int = 4):Array { return notes.map(function(note:SongNoteData):SongNoteData { var newData = note.data; @@ -149,7 +150,7 @@ class SongDataUtils * * Offset the provided array of notes such that the first note is at 0 milliseconds. */ - public static function buildNoteClipboard(notes:Array, ?timeOffset:Int = null):Array + public static function buildNoteClipboard(notes:Array, ?timeOffset:Int):Array { if (notes.length == 0) return notes; if (timeOffset == null) timeOffset = Std.int(notes[0].time); @@ -161,7 +162,7 @@ class SongDataUtils * * Offset the provided array of events such that the first event is at 0 milliseconds. */ - public static function buildEventClipboard(events:Array, ?timeOffset:Int = null):Array + public static function buildEventClipboard(events:Array, ?timeOffset:Int):Array { if (events.length == 0) return events; if (timeOffset == null) timeOffset = Std.int(events[0].time); diff --git a/source/funkin/data/stickers/StickerRegistry.hx b/source/funkin/data/stickers/StickerRegistry.hx index 08c2b9669..44f47140f 100644 --- a/source/funkin/data/stickers/StickerRegistry.hx +++ b/source/funkin/data/stickers/StickerRegistry.hx @@ -4,6 +4,7 @@ import funkin.data.stickers.StickerData; import funkin.ui.transition.stickers.StickerPack; import funkin.ui.transition.stickers.ScriptedStickerPack; +@:nullSafety class StickerRegistry extends BaseRegistry { /** @@ -24,7 +25,9 @@ class StickerRegistry extends BaseRegistry public function fetchDefault():StickerPack { - return fetchEntry(Constants.DEFAULT_STICKER_PACK); + var stickerPack:Null = fetchEntry(Constants.DEFAULT_STICKER_PACK); + if (stickerPack == null) throw 'Default sticker pack was null! This should not happen!'; + return stickerPack; } /** diff --git a/source/funkin/input/Controls.hx b/source/funkin/input/Controls.hx index 2d7a2a568..fff31206d 100644 --- a/source/funkin/input/Controls.hx +++ b/source/funkin/input/Controls.hx @@ -484,8 +484,7 @@ class Controls extends FlxActionSet static function init():Void { - var actions = new FlxActionManager(); - FlxG.inputs.add(actions); + FlxG.inputs.addUniqueType(new FlxActionManager()); } /** diff --git a/source/funkin/mobile/input/PreciseInputHandler.hx b/source/funkin/mobile/input/PreciseInputHandler.hx index b4c243ce6..f240a2c94 100644 --- a/source/funkin/mobile/input/PreciseInputHandler.hx +++ b/source/funkin/mobile/input/PreciseInputHandler.hx @@ -31,7 +31,6 @@ class PreciseInputHandler static function handleHintDown(hint:FunkinHint):Void { final timestamp:Int64 = PreciseInputManager.getCurrentTimestamp(); - @:privateAccess if (hint.input?.justPressed ?? false) { @@ -48,7 +47,6 @@ class PreciseInputHandler static function handleHintUp(hint:FunkinHint):Void { final timestamp:Int64 = PreciseInputManager.getCurrentTimestamp(); - @:privateAccess if (hint.input?.justReleased ?? false) { diff --git a/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx b/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx index 34ba6dd01..78960af63 100644 --- a/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx +++ b/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx @@ -290,6 +290,7 @@ class ControlsSchemeMenu extends MusicBeatSubState }); } + #if FEATURE_TOUCH_CONTROLS /** * Handles touch dragging. */ @@ -344,7 +345,7 @@ class ControlsSchemeMenu extends MusicBeatSubState if (TouchUtil.pressed && dragDistance != 0) { final showcasesTargetX:Float = originX + dragDistance * 10; - hitboxShowcases.x = MathUtil.smoothLerp(hitboxShowcases.x, showcasesTargetX, elapsed, 0.5); + hitboxShowcases.x = MathUtil.smoothLerpPrecision(hitboxShowcases.x, showcasesTargetX, elapsed, 0.5); final minShowcasesX:Float = -1500 * availableSchemes.length; hitboxShowcases.x = FlxMath.bound(hitboxShowcases.x, minShowcasesX, 400); @@ -355,7 +356,8 @@ class ControlsSchemeMenu extends MusicBeatSubState } else { - hitboxShowcases.x = MathUtil.smoothLerp(hitboxShowcases.x, (-1500 * currentIndex) + (-1500 / (availableSchemes.length + 1) * currentIndex), elapsed, 0.5); + hitboxShowcases.x = MathUtil.smoothLerpPrecision(hitboxShowcases.x, (-1500 * currentIndex) + (-1500 / (availableSchemes.length + 1) * currentIndex), elapsed, 0.5); } + #end } } diff --git a/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx b/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx index 9e515b969..270ebb729 100644 --- a/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx +++ b/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx @@ -110,7 +110,7 @@ class HitboxShowcase extends FlxSpriteGroup { super.update(elapsed); - alpha = MathUtil.smoothLerp(alpha, HITBOX_SHOWCASE_ALPHA[selected ? 1 : 0], elapsed, 0.2); + alpha = MathUtil.smoothLerpPrecision(alpha, HITBOX_SHOWCASE_ALPHA[selected ? 1 : 0], elapsed, 0.2); } function get_selected():Bool diff --git a/source/funkin/mobile/util/InAppPurchasesUtil.hx b/source/funkin/mobile/util/InAppPurchasesUtil.hx index f71239a2f..932568fe1 100644 --- a/source/funkin/mobile/util/InAppPurchasesUtil.hx +++ b/source/funkin/mobile/util/InAppPurchasesUtil.hx @@ -190,7 +190,11 @@ class InAppPurchasesUtil } } - IAPAndroid.onPurchasesUpdated.add(purchasesUpdatedEvent); + if (!IAPAndroid.onPurchasesUpdated.has(purchasesUpdatedEvent)) + { + IAPAndroid.onPurchasesUpdated.add(purchasesUpdatedEvent); + } + IAPAndroid.launchPurchaseFlow(product); return; } @@ -203,21 +207,21 @@ class InAppPurchasesUtil { if (purchase.getPaymentProductIdentifier() == id) { - switch (purchase.getTransactionState()) + if (purchase.getTransactionState() == IAPPurchaseState.PURCHASED) { - case IAPPurchaseState.PURCHASED | IAPPurchaseState.RESTORED: - if (onPurchased != null) onPurchased(); + if (onPurchased != null) onPurchased(); - IAPIOS.onPurchasesUpdated.remove(purchasesUpdatedEvent); - case IAPPurchaseState.FAILED: - IAPIOS.onPurchasesUpdated.remove(purchasesUpdatedEvent); - default: + IAPIOS.onPurchasesUpdated.remove(purchasesUpdatedEvent); } } } } - IAPIOS.onPurchasesUpdated.add(purchasesUpdatedEvent); + if (!IAPIOS.onPurchasesUpdated.has(purchasesUpdatedEvent)) + { + IAPIOS.onPurchasesUpdated.add(purchasesUpdatedEvent); + } + IAPIOS.purchaseProduct(product); return; } diff --git a/source/funkin/play/GameOverSubState.hx b/source/funkin/play/GameOverSubState.hx index 9a0717f7b..b23c2a14e 100644 --- a/source/funkin/play/GameOverSubState.hx +++ b/source/funkin/play/GameOverSubState.hx @@ -277,7 +277,7 @@ class GameOverSubState extends MusicBeatSubState } // Smoothly lerp the camera - FlxG.camera.zoom = MathUtil.smoothLerp(FlxG.camera.zoom, targetCameraZoom, elapsed, CAMERA_ZOOM_DURATION); + FlxG.camera.zoom = MathUtil.smoothLerpPrecision(FlxG.camera.zoom, targetCameraZoom, elapsed, CAMERA_ZOOM_DURATION); // // Handle user inputs. diff --git a/source/funkin/play/PauseSubState.hx b/source/funkin/play/PauseSubState.hx index 01b73e294..42f2deaa2 100644 --- a/source/funkin/play/PauseSubState.hx +++ b/source/funkin/play/PauseSubState.hx @@ -552,6 +552,7 @@ class PauseSubState extends MusicBeatSubState changeSelection(1); } + #if FEATURE_TOUCH_CONTROLS if (!SwipeUtil.justSwipedAny && !justOpened) { for (i in 0...menuEntryText.members.length) @@ -571,6 +572,7 @@ class PauseSubState extends MusicBeatSubState break; } } + #end if (controls.ACCEPT) { diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 357fc479b..b926ed6a0 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -619,6 +619,12 @@ class PlayState extends MusicBeatSubState return FlxG?.sound?.music?.length; } + /** + * The threshold for resyncing the song. + * If the vocals deviate from the instrumental by more than this amount, then `resyncVocals()` will be called. + */ + static final RESYNC_THRESHOLD:Float = 30; + // TODO: Refactor or document var generatedMusic:Bool = false; @@ -1689,9 +1695,9 @@ class PlayState extends MusicBeatSubState } if (!startingSong - && (Math.abs(FlxG.sound.music.time - correctSync) > 100 - || Math.abs(playerVoicesError) > 100 - || Math.abs(opponentVoicesError) > 100)) + && (Math.abs(FlxG.sound.music.time - correctSync) > RESYNC_THRESHOLD + || Math.abs(playerVoicesError) > RESYNC_THRESHOLD + || Math.abs(opponentVoicesError) > RESYNC_THRESHOLD)) { trace("VOCALS NEED RESYNC"); if (vocals != null) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index f2f5bbb9f..314c2a3ed 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -48,6 +48,7 @@ import funkin.mobile.util.AdMobUtil; import funkin.mobile.util.InAppReviewUtil; #end #end +import funkin.util.DeviceUtil; /** * The state for the results screen after a song or week is finished. @@ -594,11 +595,12 @@ class ResultState extends MusicBeatSubState // ratingsPopin.animation.play("idle"); // ratingsPopin.visible = true; - ratingsPopin.animation.onFinish.add(anim -> { - // scorePopin.animation.play("score"); + ratingsPopin.animation.onFinish.add(anim -> + { + // scorePopin.animation.play("score"); - // scorePopin.visible = true; - }); + // scorePopin.visible = true; + }); } refresh(); @@ -1049,6 +1051,16 @@ class ResultState extends MusicBeatSubState } else { + FlxG.signals.preStateSwitch.addOnce(function() { + #if ios + trace(DeviceUtil.iPhoneNumber); + if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); + else + funkin.FunkinMemory.purgeCache(); + #else + funkin.FunkinMemory.purgeCache(true); + #end + }); FlxG.switchState(() -> targetState); } } @@ -1069,6 +1081,16 @@ class ResultState extends MusicBeatSubState } else { + FlxG.signals.preStateSwitch.addOnce(function() { + #if ios + trace(DeviceUtil.iPhoneNumber); + if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); + else + funkin.FunkinMemory.purgeCache(); + #else + funkin.FunkinMemory.purgeCache(true); + #end + }); FlxG.switchState(() -> targetState); } } diff --git a/source/funkin/play/components/HealthIcon.hx b/source/funkin/play/components/HealthIcon.hx index f6430457f..459869bd9 100644 --- a/source/funkin/play/components/HealthIcon.hx +++ b/source/funkin/play/components/HealthIcon.hx @@ -210,7 +210,7 @@ class HealthIcon extends FunkinSprite lerpIconSize(); // Lerp the health icon back to its normal angle. - this.angle = MathUtil.coolLerp(this.angle, 0, 0.15); + this.angle = MathUtil.smoothLerpPrecision(this.angle, 0, elapsed, 0.512); } this.updatePosition(); @@ -228,7 +228,7 @@ class HealthIcon extends FunkinSprite if (this.width > this.height) { // Apply linear interpolation while accounting for frame rate. - var targetSize:Int = Std.int(MathUtil.coolLerp(this.width, HEALTH_ICON_SIZE * this.size.x, 0.15)); + var targetSize:Int = Std.int(MathUtil.smoothLerpPrecision(this.width, HEALTH_ICON_SIZE * this.size.x, FlxG.elapsed, 0.512)); if (force) targetSize = Std.int(HEALTH_ICON_SIZE * this.size.x); @@ -236,7 +236,7 @@ class HealthIcon extends FunkinSprite } else { - var targetSize:Int = Std.int(MathUtil.coolLerp(this.height, HEALTH_ICON_SIZE * this.size.y, 0.15)); + var targetSize:Int = Std.int(MathUtil.smoothLerpPrecision(this.height, HEALTH_ICON_SIZE * this.size.y, FlxG.elapsed, 0.512)); if (force) targetSize = Std.int(HEALTH_ICON_SIZE * this.size.y); diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index 803e62931..ed7295abc 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -194,14 +194,13 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry; + var result:Null = null; if (includeScript && SongRegistry.instance.isScriptedEntry(songId)) { - var songClassName:String = SongRegistry.instance.getScriptedEntryClassName(songId); - + var songClassName:Null = SongRegistry.instance.getScriptedEntryClassName(songId); @:privateAccess - result = SongRegistry.instance.createScriptedEntry(songClassName); + if (songClassName != null) result = SongRegistry.instance.createScriptedEntry(songClassName); } else { diff --git a/source/funkin/ui/MenuItem.hx b/source/funkin/ui/MenuItem.hx index 559050919..80ee8af81 100644 --- a/source/funkin/ui/MenuItem.hx +++ b/source/funkin/ui/MenuItem.hx @@ -41,7 +41,7 @@ class MenuItem extends FlxSpriteGroup override function update(elapsed:Float) { super.update(elapsed); - y = MathUtil.coolLerp(y, (targetY * 120) + 480, 0.17); + y = MathUtil.smoothLerpPrecision(y, (targetY * 120) + 480, elapsed, 0.451); if (isFlashing) { diff --git a/source/funkin/ui/charSelect/CharSelectGF.hx b/source/funkin/ui/charSelect/CharSelectGF.hx index c214d54de..c6543a80e 100644 --- a/source/funkin/ui/charSelect/CharSelectGF.hx +++ b/source/funkin/ui/charSelect/CharSelectGF.hx @@ -91,7 +91,7 @@ class CharSelectGF extends FlxAtlasSprite implements IBPMSyncedScriptedClass for (i in 0...len) { - var animFrame:Int = Math.round(levels[i].value * 12); + var animFrame:Int = (FlxG.sound.volume == 0 || FlxG.sound.muted) ? 0 : Math.round(levels[i].value * 12); #if sys // Web version scales with the Flixel volume level. diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index 9c26a3984..b1d113e14 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -57,7 +57,6 @@ class CharSelectSubState extends MusicBeatSubState var cursorOffsetX:Float = -16; var cursorOffsetY:Float = -48; var cursorLocIntended:FlxPoint = new FlxPoint(0, 0); - var lerpAmnt:Float = 0.95; var tmrFrames:Int = 60; var currentStage:Stage; var playerChill:CharSelectPlayer; @@ -786,12 +785,14 @@ class CharSelectSubState extends MusicBeatSubState mobileAccept = false; - if (controls.UI_UP_R || controls.UI_DOWN_R || controls.UI_LEFT_R || controls.UI_RIGHT_R || TouchUtil.justReleased) selectSound.pitch = 1; + if (controls.UI_UP_R || controls.UI_DOWN_R || controls.UI_LEFT_R || controls.UI_RIGHT_R #if FEATURE_TOUCH_CONTROLS || TouchUtil.justReleased #end) + selectSound.pitch = 1; syncAudio(elapsed); if (allowInput && !pressedSelect) { + #if FEATURE_TOUCH_CONTROLS if (TouchUtil.pressed || TouchUtil.justReleased) { for (i => hitbox in grpHitboxes.members) @@ -822,6 +823,7 @@ class CharSelectSubState extends MusicBeatSubState { mobileAccept = true; } + #end // if (controls.UI_UP) holdTmrUp += elapsed; @@ -913,7 +915,7 @@ class CharSelectSubState extends MusicBeatSubState { curChar = availableChars.get(getCurrentSelected()); - if (allowInput && pressedSelect && (controls.BACK || (mobileDeny && TouchUtil.justReleased))) + if (allowInput && pressedSelect && (controls.BACK #if FEATURE_TOUCH_CONTROLS || (mobileDeny && TouchUtil.justReleased) #end)) { mobileDeny = false; cursorConfirmed.visible = false; @@ -969,7 +971,9 @@ class CharSelectSubState extends MusicBeatSubState goToFreeplay(); }); } + #if FEATURE_TOUCH_CONTROLS else if (pressedSelect && TouchUtil.justReleased) mobileDeny = true; + #end mobileAccept = false; } @@ -1011,14 +1015,14 @@ class CharSelectSubState extends MusicBeatSubState cursorLocIntended.x += cursorOffsetX; cursorLocIntended.y += cursorOffsetY; - cursor.x = MathUtil.smoothLerp(cursor.x, cursorLocIntended.x, elapsed, 0.1); - cursor.y = MathUtil.smoothLerp(cursor.y, cursorLocIntended.y, elapsed, 0.1); + cursor.x = MathUtil.snap(MathUtil.smoothLerpPrecision(cursor.x, cursorLocIntended.x, elapsed, 0.1), cursorLocIntended.x, 1); + cursor.y = MathUtil.snap(MathUtil.smoothLerpPrecision(cursor.y, cursorLocIntended.y, elapsed, 0.1), cursorLocIntended.y, 1); - cursorBlue.x = MathUtil.coolLerp(cursorBlue.x, cursor.x, lerpAmnt * 0.4); - cursorBlue.y = MathUtil.coolLerp(cursorBlue.y, cursor.y, lerpAmnt * 0.4); + cursorBlue.x = MathUtil.smoothLerpPrecision(cursorBlue.x, cursor.x, elapsed, 0.202); + cursorBlue.y = MathUtil.smoothLerpPrecision(cursorBlue.y, cursor.y, elapsed, 0.202); - cursorDarkBlue.x = MathUtil.coolLerp(cursorDarkBlue.x, cursorLocIntended.x, lerpAmnt * 0.2); - cursorDarkBlue.y = MathUtil.coolLerp(cursorDarkBlue.y, cursorLocIntended.y, lerpAmnt * 0.2); + cursorDarkBlue.x = MathUtil.smoothLerpPrecision(cursorDarkBlue.x, cursorLocIntended.x, elapsed, 0.404); + cursorDarkBlue.y = MathUtil.smoothLerpPrecision(cursorDarkBlue.y, cursorLocIntended.y, elapsed, 0.404); cursorConfirmed.x = cursor.x - 2; cursorConfirmed.y = cursor.y - 4; diff --git a/source/funkin/ui/charSelect/CharacterUnlockState.hx b/source/funkin/ui/charSelect/CharacterUnlockState.hx index 4ea032f4a..5ae3a8c62 100644 --- a/source/funkin/ui/charSelect/CharacterUnlockState.hx +++ b/source/funkin/ui/charSelect/CharacterUnlockState.hx @@ -15,6 +15,7 @@ import funkin.data.freeplay.player.PlayerRegistry; import funkin.ui.mainmenu.MainMenuState; #if mobile import funkin.util.TouchUtil; +import funkin.util.DeviceUtil; #end using flixel.util.FlxSpriteUtil; @@ -125,7 +126,14 @@ class CharacterUnlockState extends MusicBeatState // Fade to black, then switch state. FlxG.camera.fade(FlxColor.BLACK, 0.75, false, () -> { funkin.FunkinMemory.clearFreeplay(); + #if ios + trace(DeviceUtil.iPhoneNumber); + if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); + else + funkin.FunkinMemory.purgeCache(); + #else funkin.FunkinMemory.purgeCache(true); + #end FlxG.switchState(() -> nextState); }); } diff --git a/source/funkin/ui/credits/CreditsState.hx b/source/funkin/ui/credits/CreditsState.hx index e12a542d6..990c763e2 100644 --- a/source/funkin/ui/credits/CreditsState.hx +++ b/source/funkin/ui/credits/CreditsState.hx @@ -7,6 +7,8 @@ import flixel.FlxSprite; import funkin.ui.mainmenu.MainMenuState; import flixel.group.FlxSpriteGroup; import funkin.util.TouchUtil; +import funkin.ui.credits.CreditsData.CreditsDataRole; +import funkin.ui.credits.CreditsData.CreditsDataMember; /** * The state used to display the credits scroll. @@ -77,6 +79,9 @@ class CreditsState extends MusicBeatState var scrollPaused:Bool = false; + var backersToBuild:Array; + var entriesToBuild:Array; + public function new() { super(); @@ -86,6 +91,22 @@ class CreditsState extends MusicBeatState { super.create(); + backersToBuild = CreditsDataHandler.fetchBackerEntries(); + + entriesToBuild = []; + for (entry in CreditsDataHandler.CREDITS_DATA.entries) + { + entriesToBuild.push( + { + data: entry, + lineIndexToBuild: 0, + backerIndexToBuild: 0, + hasBuiltHeader: (entry.header == null), + hasBuiltBody: (entry.body.length == 0), + hasBuiltBackers: (!entry.appendBackers || backersToBuild.length == 0) + }); + } + // Background var bg = new FlxSprite(Paths.image('menuDesat')); bg.scrollFactor.x = 0; @@ -105,7 +126,7 @@ class CreditsState extends MusicBeatState creditsGroup.x = Math.max(funkin.ui.FullScreenScaleMode.gameNotchSize.x, SCREEN_PAD); creditsGroup.y = STARTING_HEIGHT; - buildCreditsGroup(); + // buildCreditsGroup(); add(creditsGroup); @@ -124,39 +145,44 @@ class CreditsState extends MusicBeatState #end } - function buildCreditsGroup():Void + var creditsLineY:Float = 0; + + function buildCreditsEntryLine(entry:CreditsEntry):Void { - var y:Float = 0; - - for (entry in CreditsDataHandler.CREDITS_DATA.entries) + if (!entry.hasBuiltHeader) { - if (entry.header != null) - { - var header = buildCreditsLine(entry.header, y, true, CreditsSide.Left); - header.bold = true; - creditsGroup.add(header); - y += CREDITS_HEADER_FONT_SIZE + (header.textField.numLines * CREDITS_HEADER_FONT_SIZE); - } + var header:FlxText = buildCreditsLine(entry.data.header, creditsLineY, true, CreditsSide.Left); + creditsLineY += CREDITS_HEADER_FONT_SIZE + (header.textField.numLines * CREDITS_HEADER_FONT_SIZE); + entry.hasBuiltHeader = true; + return; + } - for (line in entry?.body ?? []) - { - var entry = buildCreditsLine(line.line, y, false, CreditsSide.Left); - creditsGroup.add(entry); - y += CREDITS_FONT_SIZE * entry.textField.numLines; - } + if (!entry.hasBuiltBody) + { + var lineData:CreditsDataMember = entry.data.body[entry.lineIndexToBuild]; + var line:FlxText = buildCreditsLine(lineData.line, creditsLineY, false, CreditsSide.Left); + creditsLineY += CREDITS_FONT_SIZE * line.textField.numLines; + entry.lineIndexToBuild++; - if (entry.appendBackers) + if (entry.lineIndexToBuild >= entry.data.body.length) { - var backers = CreditsDataHandler.fetchBackerEntries(); - for (backer in backers) - { - creditsGroup.add(buildCreditsLine(backer, y, false, CreditsSide.Left)); - y += CREDITS_FONT_SIZE; - } + entry.hasBuiltBody = true; } + return; + } - // Padding between each role. - y += CREDITS_FONT_SIZE * 2.5; + if (!entry.hasBuiltBackers) + { + var backer:String = backersToBuild[entry.backerIndexToBuild]; + creditsGroup.add(buildCreditsLine(backer, creditsLineY, false, CreditsSide.Left)); + creditsLineY += CREDITS_FONT_SIZE; + + entry.backerIndexToBuild++; + if (entry.backerIndexToBuild >= backersToBuild.length) + { + entry.hasBuiltBackers = true; + } + return; } } @@ -169,16 +195,66 @@ class CreditsState extends MusicBeatState var width = (side == CreditsSide.Center) ? FULL_WIDTH : (FULL_WIDTH / 2); var size = header ? CREDITS_HEADER_FONT_SIZE : CREDITS_FONT_SIZE; - var creditsLine:FlxText = new FlxText(xPos, yPos, width, text); + // using a cast since creditsGroup is FlxSpriteGroup + // we could also do FlxTypedSpriteGroup + var creditsLine:FlxText = cast(creditsGroup.recycle(() -> new FlxText()), FlxText); + creditsLine.x = xPos + creditsGroup.x; + creditsLine.y = yPos + creditsGroup.y; + creditsLine.fieldWidth = width; + creditsLine.text = text; + creditsLine.bold = header; creditsLine.setFormat(CREDITS_FONT, size, CREDITS_FONT_COLOR, FlxTextAlign.LEFT, FlxTextBorderStyle.OUTLINE, CREDITS_FONT_STROKE_COLOR, true); return creditsLine; } + function killOffScreenLines():Void + { + creditsGroup.forEachExists(function(creditsLine:FlxSprite) { + if (creditsLine.y + creditsLine.height <= 0) + { + creditsLine.kill(); + trace("killed line"); + } + }); + } + + function buildNextLine():Void + { + // no more entriesToBuild + if (entriesToBuild.length == 0) + { + return; + } + + // line is off-screen + if (creditsGroup.y + creditsLineY >= FlxG.height) + { + return; + } + + var entry:CreditsEntry = entriesToBuild[0]; + buildCreditsEntryLine(entry); + + // check if everything has been built + if (!entry.hasBuiltHeader || !entry.hasBuiltBody || !entry.hasBuiltBackers) + { + return; + } + + entriesToBuild.shift(); + + // offset that each entry has + creditsLineY += CREDITS_FONT_SIZE * 2.5; + } + public override function update(elapsed:Float):Void { super.update(elapsed); + killOffScreenLines(); + buildNextLine(); + if (!scrollPaused) { // TODO: Replace with whatever the special note button is. @@ -206,7 +282,7 @@ class CreditsState extends MusicBeatState function hasEnded():Bool { - return creditsGroup.y < -creditsGroup.height; + return creditsGroup.getFirstExisting() == null && entriesToBuild.length == 0; } function exit():Void @@ -226,3 +302,13 @@ enum CreditsSide Center; Right; } + +typedef CreditsEntry = +{ + var data:CreditsDataRole; + var lineIndexToBuild:Int; + var backerIndexToBuild:Int; + var hasBuiltHeader:Bool; + var hasBuiltBody:Bool; + var hasBuiltBackers:Bool; +} diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 35186480a..06e28a46a 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -3399,18 +3399,22 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // These ones only happen if the modal dialog is not open. handleScrollKeybinds(); - handleSnap(); handleCursor(); + if (!(isHaxeUIFocused || isCursorOverHaxeUI)) + { + handleSnap(); + handlePlayhead(); + handleEditKeybinds(); + } + handleMenubar(); handleToolboxes(); handlePlaybar(); - handlePlayhead(); handleNotePreview(); handleHealthIcons(); handleFileKeybinds(); - handleEditKeybinds(); handleViewKeybinds(); handleTestKeybinds(); handleHelpKeybinds(); @@ -3601,30 +3605,16 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { if (holdNoteSprite == null || holdNoteSprite.noteData == null || !holdNoteSprite.exists || !holdNoteSprite.visible) continue; - // Fixes an issue where dragging an hold note too far would hide its sustain trail + // Fixes an issue where dragging a hold note too far would hide its sustain trail var isSelectedAndDragged = currentNoteSelection.fastContains(holdNoteSprite.noteData) && (dragTargetCurrentStep != 0); - if (holdNoteSprite.noteData == currentPlaceNoteData) + if (!isSelectedAndDragged + && (holdNoteSprite.noteData == currentPlaceNoteData // Being dragged, displayed by gridGhostHoldNoteSprite instead. + || !holdNoteSprite.isHoldNoteVisible(viewAreaBottomPixels, viewAreaTopPixels) // Off-screen. + || !currentSongChartNoteData.fastContains(holdNoteSprite.noteData) // Deleted. + || holdNoteSprite.noteData.length == 0 // Also deleted. + )) { - // This hold note is for the note we are currently dragging. - // It will be displayed by gridGhostHoldNoteSprite instead. - holdNoteSprite.kill(); - } - else if (!holdNoteSprite.isHoldNoteVisible(viewAreaBottomPixels, viewAreaTopPixels) && !isSelectedAndDragged) - { - // This hold note is off-screen. - // Kill the hold note sprite and recycle it. - holdNoteSprite.kill(); - } - else if (!currentSongChartNoteData.fastContains(holdNoteSprite.noteData) || holdNoteSprite.noteData.length == 0) - { - // This hold note was deleted. - // Kill the hold note sprite and recycle it. - holdNoteSprite.kill(); - } - else if (displayedHoldNoteData.fastContains(holdNoteSprite.noteData)) - { - // This hold note is a duplicate. // Kill the hold note sprite and recycle it. holdNoteSprite.kill(); } @@ -3632,8 +3622,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { displayedHoldNoteData.push(holdNoteSprite.noteData); // Update the hold note sprite's height and position. - // var holdNoteHeight = holdNoteSprite.noteData.getStepLength() * GRID_SIZE; - // holdNoteSprite.setHeightDirectly(holdNoteHeight); + var holdNoteHeight = holdNoteSprite.noteData.getStepLength() * GRID_SIZE; + holdNoteSprite.setHeightDirectly(holdNoteHeight); holdNoteSprite.updateHoldNotePosition(renderedHoldNotes); } } @@ -3800,8 +3790,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState holdNoteSprite.noteStyle = NoteKindManager.getNoteStyleId(noteData.kind, currentSongNoteStyle) ?? currentSongNoteStyle; holdNoteSprite.updateHoldNotePosition(renderedHoldNotes); - - displayedHoldNoteData.push(noteData); } // Destroy all existing selection squares. @@ -6299,7 +6287,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { currentScrollEase = Math.max(0, targetScrollPosition); currentScrollEase = Math.min(currentScrollEase, songLengthInPixels); - scrollPositionInPixels = MathUtil.smoothLerp(scrollPositionInPixels, currentScrollEase, FlxG.elapsed, SCROLL_EASE_DURATION, 1 / 1000); + scrollPositionInPixels = MathUtil.snap(MathUtil.smoothLerpPrecision(scrollPositionInPixels, currentScrollEase, FlxG.elapsed, SCROLL_EASE_DURATION, 1 / 1000), currentScrollEase, 1 / 1000); moveSongToScrollPosition(); } diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx index 8a014cd3c..f23138a35 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx @@ -1168,6 +1168,10 @@ class ChartEditorDialogHandler if (dialogSongArtist == null) throw 'Could not locate dialogSongArtist TextField in Add Variation dialog'; dialogSongArtist.value = state.currentSongMetadata.artist; + var dialogSongCharter:Null = dialog.findComponent('dialogSongCharter', TextField); + if (dialogSongCharter == null) throw 'Could not locate dialogSongCharter TextField in Add Variation dialog'; + dialogSongCharter.value = state.currentSongMetadata.charter; + var dialogStage:Null = dialog.findComponent('dialogStage', DropDown); if (dialogStage == null) throw 'Could not locate dialogStage DropDown in Add Variation dialog'; var startingValueStage = ChartEditorDropdowns.populateDropdownWithStages(dialogStage, state.currentSongMetadata.playData.stage); diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx index d7ac0e042..640c62491 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx @@ -118,7 +118,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox if (valid) { - chartEditorState.currentSongNoteStyle = event.data.id; + chartEditorState.currentSongNoteStyle = event.data.id; } }; var startingValueNoteStyle = ChartEditorDropdowns.populateDropdownWithNoteStyles(inputNoteStyle, chartEditorState.currentSongMetadata.playData.noteStyle); diff --git a/source/funkin/ui/debug/latency/LatencyState.hx b/source/funkin/ui/debug/latency/LatencyState.hx index cb9ade241..be2bd0f46 100644 --- a/source/funkin/ui/debug/latency/LatencyState.hx +++ b/source/funkin/ui/debug/latency/LatencyState.hx @@ -412,7 +412,7 @@ class LatencyState extends MusicBeatSubState if (TouchUtil.overlapsComplex(visualOffsetRightArrow) && touchPressCheck) { cleanup(); - FlxG.switchState(() -> new funkin.ui.options.OptionsState()); + FlxG.switchState(() -> new funkin.ui.options.OptionsState()); localConductor.audioVisualOffset += 1 * multiply; } diff --git a/source/funkin/ui/debug/stageeditor/StageEditorState.hx b/source/funkin/ui/debug/stageeditor/StageEditorState.hx index b05ae1f15..266ff7a7c 100644 --- a/source/funkin/ui/debug/stageeditor/StageEditorState.hx +++ b/source/funkin/ui/debug/stageeditor/StageEditorState.hx @@ -1260,14 +1260,13 @@ class StageEditorState extends UIState if (exitConfirmDialog == null) { exitConfirmDialog = Dialogs.messageBox("You are about to leave the Editor without Saving.\n\nAre you sure? ", "Leave Editor", - MessageBoxType.TYPE_YESNO, true, - function(btn:DialogButton) { + MessageBoxType.TYPE_YESNO, true, function(btn:DialogButton) { exitConfirmDialog = null; - if (btn == DialogButton.YES) - { - saved = true; - onMenuItemClick("exit"); - } + if (btn == DialogButton.YES) + { + saved = true; + onMenuItemClick("exit"); + } }); } diff --git a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectAnimsToolbox.hx b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectAnimsToolbox.hx index 6cd0b4f4e..548feb444 100644 --- a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectAnimsToolbox.hx +++ b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectAnimsToolbox.hx @@ -114,7 +114,7 @@ class StageEditorObjectAnimsToolbox extends StageEditorDefaultToolbox objAnims.selectedIndex = objAnims.dataSource.size - 1; } - + this.onDialogClosed = onClose; } diff --git a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectGraphicToolbox.hx b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectGraphicToolbox.hx index 01e007527..e3eb32570 100644 --- a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectGraphicToolbox.hx +++ b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectGraphicToolbox.hx @@ -137,7 +137,9 @@ class StageEditorObjectGraphicToolbox extends StageEditorDefaultToolbox // Set the names of the frames. for (i in 0...linkedObj.frames.frames.length) { - linkedObj.frames.framesHash.set('Frame$i', linkedObj.frames.frames[i]); + @:privateAccess + linkedObj.frames.framesByName.set('Frame$i', linkedObj.frames.frames[i]); + linkedObj.frames.frames[i].name = 'Frame$i'; } @@ -146,7 +148,7 @@ class StageEditorObjectGraphicToolbox extends StageEditorDefaultToolbox stageEditorState.updateDialog(OBJECT_ANIMS); } - + this.onDialogClosed = onClose; } diff --git a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectPropertiesToolbox.hx b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectPropertiesToolbox.hx index 8c0ae8655..5dd3aceaa 100644 --- a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectPropertiesToolbox.hx +++ b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectPropertiesToolbox.hx @@ -121,7 +121,7 @@ class StageEditorObjectPropertiesToolbox extends StageEditorDefaultToolbox linkedObj.color = FlxColor.fromString(_.value) ?? 0xFFFFFFFF; } } - + this.onDialogClosed = onClose; } diff --git a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorStageToolbox.hx b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorStageToolbox.hx index c8077c667..0224e693a 100644 --- a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorStageToolbox.hx +++ b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorStageToolbox.hx @@ -51,7 +51,7 @@ class StageEditorStageToolbox extends StageEditorDefaultToolbox } refresh(); - + this.onDialogClosed = onClose; } diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index f10ac86e2..1be337cd1 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1329,7 +1329,8 @@ class FreeplayState extends MusicBeatSubState fadeShader.fade(1.0, 0.0, 0.8, {ease: FlxEase.quadIn}); FlxG.sound.music?.fadeOut(0.9, 0); new FlxTimer().start(0.9, _ -> { - FlxG.switchState(new funkin.ui.charSelect.CharSelectSubState({character: currentCharacterId} // Passing the currrent Freeplay character to the CharSelect so we can start it with that character selected + FlxG.switchState(() -> + new funkin.ui.charSelect.CharSelectSubState({character: currentCharacterId} // Passing the currrent Freeplay character to the CharSelect so we can start it with that character selected )); }); for (grpSpr in exitMoversCharSel.keys()) @@ -1501,8 +1502,8 @@ class FreeplayState extends MusicBeatSubState changeSelection(grpCapsules.countLiving() - curSelected - 1); } - lerpScore = MathUtil.smoothLerp(lerpScore, intendedScore, elapsed, 0.5); - lerpCompletion = MathUtil.smoothLerp(lerpCompletion, intendedCompletion, elapsed, 0.5); + lerpScore = MathUtil.snap(MathUtil.smoothLerpPrecision(lerpScore, intendedScore, elapsed, 0.2), intendedScore, 1); + lerpCompletion = MathUtil.snap(MathUtil.smoothLerpPrecision(lerpCompletion, intendedCompletion, elapsed, 0.5), intendedCompletion, 1 / 100); if (Math.isNaN(lerpScore)) { @@ -1898,6 +1899,7 @@ class FreeplayState extends MusicBeatSubState for (diff in grpDifficulties.group.members) { + if (busy) break; if (diff == null || diff.difficultyId != currentDifficulty) continue; if (!TouchUtil.overlaps(diff, funnyCam)) { @@ -1906,7 +1908,7 @@ class FreeplayState extends MusicBeatSubState } draggingDifficulty = true; - if (TouchUtil.justPressed) _dragOffset = diff.x - TouchUtil.touch.x; + if (_dragOffset == 0 && TouchUtil.pressed) _dragOffset = diff.x - TouchUtil.touch.x; diff.x = TouchUtil.touch.x + _dragOffset; if (TouchUtil.justReleased) diff --git a/source/funkin/ui/freeplay/FreeplayStyle.hx b/source/funkin/ui/freeplay/FreeplayStyle.hx index f2fb8b7fa..037aaf056 100644 --- a/source/funkin/ui/freeplay/FreeplayStyle.hx +++ b/source/funkin/ui/freeplay/FreeplayStyle.hx @@ -21,7 +21,6 @@ class FreeplayStyle implements IRegistryEntry * The full data for a freeplay style. */ // public final _data:FreeplayStyleData; - public function new(id:String) { this.id = id; diff --git a/source/funkin/ui/freeplay/LetterSort.hx b/source/funkin/ui/freeplay/LetterSort.hx index 7ef9084bd..4112f33e2 100644 --- a/source/funkin/ui/freeplay/LetterSort.hx +++ b/source/funkin/ui/freeplay/LetterSort.hx @@ -107,6 +107,7 @@ class LetterSort extends FlxSpriteGroup if (inputEnabled) { + #if FEATURE_TOUCH_CONTROLS if (TouchUtil.pressAction()) { for (index => letter in letterHitboxes) @@ -132,12 +133,15 @@ class LetterSort extends FlxSpriteGroup break; } } + #end @:privateAccess { - if (controls.FREEPLAY_LEFT || (TouchUtil.overlaps(swipeBounds, instance.funnyCam) && SwipeUtil.swipeLeft)) changeSelection(-1); + if (controls.FREEPLAY_LEFT #if FEATURE_TOUCH_CONTROLS + || (TouchUtil.overlaps(swipeBounds, instance.funnyCam) && SwipeUtil.swipeLeft) #end) changeSelection(-1); - if (controls.FREEPLAY_RIGHT || (TouchUtil.overlaps(swipeBounds, instance.funnyCam) && SwipeUtil.swipeRight)) changeSelection(1); + if (controls.FREEPLAY_RIGHT #if FEATURE_TOUCH_CONTROLS + || (TouchUtil.overlaps(swipeBounds, instance.funnyCam) && SwipeUtil.swipeRight) #end) changeSelection(1); } } } diff --git a/source/funkin/ui/freeplay/SongMenuItem.hx b/source/funkin/ui/freeplay/SongMenuItem.hx index 887a4b3c4..b8cb38264 100644 --- a/source/funkin/ui/freeplay/SongMenuItem.hx +++ b/source/funkin/ui/freeplay/SongMenuItem.hx @@ -661,8 +661,8 @@ class SongMenuItem extends FlxSpriteGroup if (doLerp) { - x = MathUtil.coolLerp(x, targetPos.x, 0.3); - y = MathUtil.coolLerp(y, targetPos.y, 0.4); + x = MathUtil.smoothLerpPrecision(x, targetPos.x, elapsed, 0.256); + y = MathUtil.smoothLerpPrecision(y, targetPos.y, elapsed, 0.192); } theActualHitbox.x = x + 100; diff --git a/source/funkin/ui/mainmenu/MainMenuState.hx b/source/funkin/ui/mainmenu/MainMenuState.hx index 2efc31031..3c07a46fe 100644 --- a/source/funkin/ui/mainmenu/MainMenuState.hx +++ b/source/funkin/ui/mainmenu/MainMenuState.hx @@ -166,6 +166,7 @@ class MainMenuState extends MusicBeatState { character: targetCharacter })); + canInteract = true; }); if (hasUpgraded) @@ -185,6 +186,7 @@ class MainMenuState extends MusicBeatState createMenuItem('upgrade', 'mainmenu/upgrade', function() { #if FEATURE_MOBILE_IAP InAppPurchasesUtil.purchase(InAppPurchasesUtil.UPGRADE_PRODUCT_ID, FlxG.resetState); + canInteract = true; #end }); } @@ -396,6 +398,7 @@ class MainMenuState extends MusicBeatState function selectMerch() { Referral.doMerchReferral(); + canInteract = true; } #end @@ -450,11 +453,11 @@ class MainMenuState extends MusicBeatState #if mobile if (gyroPan != null && bg != null) { - gyroPan.add(FlxG.gyroscope.pitch * -3, FlxG.gyroscope.roll * 3); + gyroPan.add(FlxG.gyroscope.pitch * -1.25, FlxG.gyroscope.roll * -1.25); // our pseudo damping - gyroPan.x = MathUtil.smoothLerp(gyroPan.x, 0, elapsed, 5); - gyroPan.y = MathUtil.smoothLerp(gyroPan.y, 0, elapsed, 5); + gyroPan.x = MathUtil.smoothLerpPrecision(gyroPan.x, 0, elapsed, 2.5); + gyroPan.y = MathUtil.smoothLerpPrecision(gyroPan.y, 0, elapsed, 2.5); // how far away from bg mid do we want to pan via gyroPan camFollow.x = bg.getGraphicMidpoint().x - gyroPan.x; diff --git a/source/funkin/ui/options/FunkinSoundTray.hx b/source/funkin/ui/options/FunkinSoundTray.hx index 047c86c96..6dd070a09 100644 --- a/source/funkin/ui/options/FunkinSoundTray.hx +++ b/source/funkin/ui/options/FunkinSoundTray.hx @@ -72,8 +72,8 @@ class FunkinSoundTray extends FlxSoundTray override public function update(ms:Float):Void { - y = MathUtil.coolLerp(y, lerpYPos, 0.1); - alpha = MathUtil.coolLerp(alpha, alphaTarget, 0.25); + y = MathUtil.smoothLerpPrecision(y, lerpYPos, ms / 1000, 0.768); + alpha = MathUtil.smoothLerpPrecision(alpha, alphaTarget, ms / 1000, 0.307); // If it has volume, we want to auto-hide after 1 second (1000ms), we simply decrement a timer var hasVolume:Bool = (!FlxG.sound.muted && FlxG.sound.volume > 0); diff --git a/source/funkin/ui/story/LevelTitle.hx b/source/funkin/ui/story/LevelTitle.hx index 6e5fb6c04..004c8be6c 100644 --- a/source/funkin/ui/story/LevelTitle.hx +++ b/source/funkin/ui/story/LevelTitle.hx @@ -49,7 +49,7 @@ class LevelTitle extends FlxSpriteGroup public override function update(elapsed:Float):Void { - this.y = MathUtil.coolLerp(y, targetY, 0.17); + this.y = MathUtil.smoothLerpPrecision(y, targetY, elapsed, 0.451); if (isFlashing) { diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index a58ebbc26..f530ebf40 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -321,7 +321,7 @@ class StoryMenuState extends MusicBeatState { Conductor.instance.update(); - highScoreLerp = Std.int(MathUtil.smoothLerp(highScoreLerp, highScore, elapsed, 0.25)); + highScoreLerp = Std.int(MathUtil.snap(MathUtil.smoothLerpPrecision(highScoreLerp, highScore, elapsed, 0.307), highScore, 1)); scoreText.text = 'LEVEL SCORE: ${Math.round(highScoreLerp)}'; @@ -391,7 +391,7 @@ class StoryMenuState extends MusicBeatState changeDifficulty(-1); } - if (controls.UI_RIGHT || TouchUtil.overlaps(rightDifficultyArrow)) + if (controls.UI_RIGHT #if FEATURE_TOUCH_CONTROLS || TouchUtil.overlaps(rightDifficultyArrow) #end) { rightDifficultyArrow.animation.play('press'); } @@ -400,7 +400,7 @@ class StoryMenuState extends MusicBeatState rightDifficultyArrow.animation.play('idle'); } - if (controls.UI_LEFT || TouchUtil.overlaps(leftDifficultyArrow)) + if (controls.UI_LEFT #if FEATURE_TOUCH_CONTROLS || TouchUtil.overlaps(leftDifficultyArrow) #end) { leftDifficultyArrow.animation.play('press'); } @@ -415,6 +415,7 @@ class StoryMenuState extends MusicBeatState selectLevel(); } + #if FEATURE_TOUCH_CONTROLS if (TouchUtil.justReleased && !TouchUtil.overlaps(leftDifficultyArrow) && !SwipeUtil.justSwipedAny) { for (i in 0...levelTitles.members.length) @@ -427,6 +428,7 @@ class StoryMenuState extends MusicBeatState (item == selectedItem) ? selectLevel() : changeLevel(i - levelList.indexOf(currentLevelId)); } } + #end } if (controls.BACK) goBack(); diff --git a/source/funkin/ui/title/TitleState.hx b/source/funkin/ui/title/TitleState.hx index fadf57025..b5aef5b44 100644 --- a/source/funkin/ui/title/TitleState.hx +++ b/source/funkin/ui/title/TitleState.hx @@ -116,8 +116,14 @@ class TitleState extends MusicBeatState add(gfDance); + #if mobile + // shift it a bit more to the left on mobile!! + titleText = new FlxSprite(50 + (FullScreenScaleMode.gameCutoutSize.x / 2), FlxG.height * 0.8); + titleText.frames = Paths.getSparrowAtlas('titleEnter_mobile'); + #else titleText = new FlxSprite(100 + (FullScreenScaleMode.gameCutoutSize.x / 2), FlxG.height * 0.8); titleText.frames = Paths.getSparrowAtlas('titleEnter'); + #end titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24); titleText.animation.addByPrefix('press', "ENTER PRESSED", 24); titleText.animation.play('idle'); diff --git a/source/funkin/ui/transition/stickers/StickerSubState.hx b/source/funkin/ui/transition/stickers/StickerSubState.hx index 7dbd0f2b1..bf7e8db45 100644 --- a/source/funkin/ui/transition/stickers/StickerSubState.hx +++ b/source/funkin/ui/transition/stickers/StickerSubState.hx @@ -15,6 +15,7 @@ import funkin.ui.freeplay.FreeplayState; import funkin.ui.MusicBeatSubState; import funkin.ui.transition.stickers.StickerPack; import funkin.FunkinMemory; +import funkin.util.DeviceUtil; using Lambda; using StringTools; @@ -257,7 +258,14 @@ class StickerSubState extends MusicBeatSubState // FlxG.addChildBelowMouse(dipshit); */ FlxG.signals.preStateSwitch.addOnce(function() { + #if ios + trace(DeviceUtil.iPhoneNumber); + if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); + else + funkin.FunkinMemory.purgeCache(); + #else funkin.FunkinMemory.purgeCache(true); + #end }); FlxG.switchState(() -> { // TODO: Rework this asset caching stuff diff --git a/source/funkin/util/DeviceUtil.hx b/source/funkin/util/DeviceUtil.hx new file mode 100644 index 000000000..d628ffb84 --- /dev/null +++ b/source/funkin/util/DeviceUtil.hx @@ -0,0 +1,90 @@ +package funkin.util; + +import lime.system.System; + +class DeviceUtil +{ + // --- iPhone Number Detection --- + #if ios + public static var iPhoneNumber(get, never):Int; + + private static function get_iPhoneNumber():Int + { + // TODO: Add ipad detection gah + if (!model.startsWith("iPhone")) return 0; // Not an iPhone, must be an ipad!! + + return switch (model) + { + // iPhone 12 Series + case "iPhone13,1": 12; + case "iPhone13,2": 12; + case "iPhone13,3": 12; + case "iPhone13,4": 12; + + // iPhone 13 Series + case "iPhone14,4": 13; + case "iPhone14,5": 13; + case "iPhone14,2": 13; + case "iPhone14,3": 13; + + // iPhone 14 Series + case "iPhone14,7": 14; + case "iPhone14,8": 14; + case "iPhone15,2": 14; + case "iPhone15,3": 14; + + // iPhone 15 Series + case "iPhone15,4": 15; + case "iPhone15,5": 15; + case "iPhone16,1": 15; + case "iPhone16,2": 15; + + // iPhone 16 Series + case "iPhone17,1": 16; + case "iPhone17,5": 16; + case "iPhone17,4": 16; + case "iPhone17,3": 16; + case "iPhone17,2": 16; + + // Unknown or newer model fallback + default: + final parts = model.substr(6).split(","); + if (parts.length == 2) + { + final major = Std.parseInt(parts[0]); + final minor = Std.parseInt(parts[1]); + if (major != null && minor != null) + { + if (major > 17 || (major == 17 && minor > 5)) + { + return 100; // future device + } + } + } + return 0; // obsolete or unknown + } + } + #end + + // --- General Device Info --- + public static var osVersion(get, null):String; + + private static function get_osVersion():String + { + return System.platformVersion; + } + + public static var vendor(get, null):String; + + private static function get_vendor():String + { + return System.deviceVendor; + } + + public static var model(get, null):String; + + private static function get_model():String + { + return System.deviceModel; + } +} diff --git a/source/funkin/util/MathUtil.hx b/source/funkin/util/MathUtil.hx index 41624fd91..a6ad11f5c 100644 --- a/source/funkin/util/MathUtil.hx +++ b/source/funkin/util/MathUtil.hx @@ -12,32 +12,6 @@ class MathUtil */ public static final E:Float = 2.71828182845904523536; - /** - * Perform linear interpolation between the base and the target, based on the current framerate. - * @param base The starting value, when `progress <= 0`. - * @param target The ending value, when `progress >= 1`. - * @param ratio Value used to interpolate between `base` and `target`. - * - * @return The interpolated value. - */ - @:deprecated('Use smoothLerp instead') - public static function coolLerp(base:Float, target:Float, ratio:Float):Float - { - return base + cameraLerp(ratio) * (target - base); - } - - /** - * Perform linear interpolation based on the current framerate. - * @param lerp Value used to interpolate between `base` and `target`. - * - * @return The interpolated value. - */ - @:deprecated('Use smoothLerp instead') - public static function cameraLerp(lerp:Float):Float - { - return lerp * (FlxG.elapsed / (1 / 60)); - } - /** * Get the logarithm of a value with a given base. * @param base The base of the logarithm. @@ -80,7 +54,7 @@ class MathUtil } /** - * Get the base-2 logarithm of a value. + * Get the base-2 exponent of a value. * @param x value * @return `2^x` */ @@ -90,19 +64,144 @@ class MathUtil } /** - * Linearly interpolate between two values. - * - * @param base The starting value, when `progress <= 0`. - * @param target The ending value, when `progress >= 1`. - * @param progress Value used to interpolate between `base` and `target`. - * @return The interpolated value. + * Performs a modulo operation to calculate the remainder of `a` divided by `b`. + * + * The definition of "remainder" varies by implementation; + * this one is similar to GLSL or Python in that it uses Euclidean division, which always returns positive, + * while Haxe's `%` operator uses signed truncated division. + * + * For example, `-5 % 3` returns `-2` while `FlxMath.mod(-5, 3)` returns `1`. + * + * @param a The dividend. + * @param b The divisor. + * @return `a mod b`. */ - public static function lerp(base:Float, target:Float, progress:Float):Float + public static function mod(a:Float, b:Float):Float { - return base + progress * (target - base); + b = Math.abs(b); + return a - b * Math.floor(a / b); } /** + * Helper function to get the fractional part of a value. + * @param x value + * @return `x mod 1`. + */ + public static function fract(x:Float):Float + { + return x - Math.floor(x); + } + + /** + * Linear interpolation. + * + * @param base The starting value, when `alpha = 0`. + * @param target The ending value, when `alpha = 1`. + * @param alpha The percentage of the interpolation from `base` to `target`. Forms a "line" intersecting the two. + * + * @return The interpolated value. + */ + public static function lerp(base:Float, target:Float, alpha:Float):Float + { + if (alpha == 0) return base; + if (alpha == 1) return target; + return base + alpha * (target - base); + } + + /** + * Exponential decay interpolation. + * + * Framerate-independent because the rate-of-change is proportional to the difference, so you can + * use the time elapsed since the last frame as `deltaTime` and the function will be consistent. + * + * Equivalent to `smoothLerpPrecision(base, target, deltaTime, halfLife, 0.5)`. + * + * @param base The starting or current value. + * @param target The value this function approaches. + * @param deltaTime The change in time along the function in seconds. + * @param halfLife Time in seconds to reach halfway to `target`. + * + * @see https://twitter.com/FreyaHolmer/status/1757918211679650262 + * + * @return The interpolated value. + */ + public static function smoothLerpDecay(base:Float, target:Float, deltaTime:Float, halfLife:Float):Float + { + if (deltaTime == 0) return base; + if (base == target) return target; + return lerp(target, base, exp2(-deltaTime / halfLife)); + } + + /** + * Exponential decay interpolation. + * + * Framerate-independent because the rate-of-change is proportional to the difference, so you can + * use the time elapsed since the last frame as `deltaTime` and the function will be consistent. + * + * Equivalent to `smoothLerpDecay(base, target, deltaTime, -duration / logBase(2, precision))`. + * + * @param base The starting or current value. + * @param target The value this function approaches. + * @param deltaTime The change in time along the function in seconds. + * @param duration Time in seconds to reach `target` within `precision`, relative to the original distance. + * @param precision Relative target precision of the interpolation. Defaults to 1% distance remaining. + * + * @see https://twitter.com/FreyaHolmer/status/1757918211679650262 + * + * @return The interpolated value. + */ + public static function smoothLerpPrecision(base:Float, target:Float, deltaTime:Float, duration:Float, precision:Float = 1 / 100):Float + { + if (deltaTime == 0) return base; + if (base == target) return target; + return lerp(target, base, Math.pow(precision, deltaTime / duration)); + } + + /** + * Snap a value to another if it's within a certain distance (inclusive). + * + * Helpful when using functions like `smoothLerpPrecision` to ensure the value actually reaches the target. + * + * @param base The base value to conditionally snap. + * @param target The target value to snap to. + * @param threshold Maximum distance between the two for snapping to occur. + * + * @return `target` if `base` is within `threshold` of it, otherwise `base`. + */ + public static function snap(base:Float, target:Float, threshold:Float):Float + { + return Math.abs(base - target) <= threshold ? target : base; + } + + /** + * Perform linear interpolation between the base and the target, based on the current framerate. + * @param base The starting value, when `progress <= 0`. + * @param target The ending value, when `progress >= 1`. + * @param ratio Value used to interpolate between `base` and `target`. + * + * @return The interpolated value. + */ + @:deprecated('Use smoothLerpPrecision instead') + public static function coolLerp(base:Float, target:Float, ratio:Float):Float + { + return base + cameraLerp(ratio) * (target - base); + } + + /** + * Perform linear interpolation based on the current framerate. + * @param lerp Value used to interpolate between `base` and `target`. + * + * @return The interpolated value. + */ + @:deprecated('Use smoothLerpPrecision instead') + public static function cameraLerp(lerp:Float):Float + { + return lerp * (FlxG.elapsed / (1 / 60)); + } + + /** + * Backwards compatibility for `smoothLerpPrecision`. + * * Perform a framerate-independent linear interpolation between the base value and the target. * @param current The current value. * @param target The target value. @@ -113,6 +212,7 @@ class MathUtil * * @return A value between the current value and the target value. */ + @:deprecated('Use smoothLerpPrecision instead') public static function smoothLerp(current:Float, target:Float, elapsed:Float, duration:Float, precision:Float = 1 / 100):Float { // An alternative algorithm which uses a separate half-life value: diff --git a/source/funkin/util/PlatformUtil.hx b/source/funkin/util/PlatformUtil.hx index f9554406f..48d19b21e 100644 --- a/source/funkin/util/PlatformUtil.hx +++ b/source/funkin/util/PlatformUtil.hx @@ -34,6 +34,10 @@ class PlatformUtil { #if html5 return HTML5; + #elseif android + return ANDROID; + #elseif ios + return IOS; #else switch (Sys.systemName()) { @@ -59,4 +63,6 @@ enum HostPlatform LINUX; MAC; HTML5; + ANDROID; + IOS; } diff --git a/source/funkin/util/TouchUtil.hx b/source/funkin/util/TouchUtil.hx index f33e5cb10..81940812b 100644 --- a/source/funkin/util/TouchUtil.hx +++ b/source/funkin/util/TouchUtil.hx @@ -68,11 +68,9 @@ class TouchUtil */ public static function overlaps(?object:FlxBasic, ?camera:FlxCamera):Bool { - #if FEATURE_TOUCH_CONTROLS if (object == null || touch == null) return false; return touch.overlaps(object, camera ?? object.camera); - #end return false; } @@ -87,14 +85,12 @@ class TouchUtil */ public static function overlapsComplex(?object:FlxObject, ?camera:FlxCamera):Bool { - #if FEATURE_TOUCH_CONTROLS if (object == null || touch == null) return false; if (camera == null) camera = object.cameras[0]; @:privateAccess return object.overlapsPoint(touch.getWorldPosition(camera, object._point), true, camera); - #end return false; } @@ -111,7 +107,6 @@ class TouchUtil */ public static function overlapsComplexPoint(?object:FlxObject, point:FlxPoint, ?inScreenSpace:Bool = false, ?camera:FlxCamera):Bool { - #if FEATURE_TOUCH_CONTROLS if (object == null || point == null) return false; if (camera == null) camera = object.cameras[0]; @@ -123,7 +118,6 @@ class TouchUtil } point.putWeak(); - #end return false; } @@ -137,7 +131,6 @@ class TouchUtil */ public static function pressAction(?object:FlxBasic, ?camera:FlxCamera, useOverlapsComplex:Bool = true):Bool { - #if FEATURE_TOUCH_CONTROLS if (TouchUtil.touch == null || (TouchUtil.touch != null && TouchUtil.touch.ticksDeltaSincePress > 200)) return false; if (object == null && camera == null) @@ -149,7 +142,6 @@ class TouchUtil final overlapsObject:Bool = useOverlapsComplex ? overlapsComplex(cast(object, FlxObject), camera) : overlaps(object, camera); return justReleased && overlapsObject; } - #end return false; } @@ -189,13 +181,10 @@ class TouchUtil } #else @:noCompletion - inline static function get_touch():FlxMouse + static function get_touch():FlxMouse { - #if FEATURE_TOUCH_CONTROLS FlxG.mouse.visible = true; return FlxG.mouse; - #end - return null; } #end } diff --git a/source/funkin/util/macro/CompiledClassList.hx b/source/funkin/util/macro/CompiledClassList.hx index e7ad721ac..623e7814c 100644 --- a/source/funkin/util/macro/CompiledClassList.hx +++ b/source/funkin/util/macro/CompiledClassList.hx @@ -50,7 +50,7 @@ class CompiledClassList } } - public static function get(request:String):Null>> + public static function get(request:String):List> { if (!initialized) init(); @@ -60,6 +60,8 @@ class CompiledClassList classLists.set(request, new List()); // Make the error only appear once. } + // A faulty request sets the value to an empty list above so this will never be null + @:nullSafety(Off) return classLists.get(request); }