diff --git a/art/burns.png b/art/burns.png index 3e7131da..89b08ba6 100644 Binary files a/art/burns.png and b/art/burns.png differ diff --git a/art/design ideas/charter events/1.png b/art/design ideas/charter events/1.png index 93eb9246..3340e41f 100644 Binary files a/art/design ideas/charter events/1.png and b/art/design ideas/charter events/1.png differ diff --git a/art/design ideas/charter events/2.png b/art/design ideas/charter events/2.png index f3206eb6..ac451a03 100644 Binary files a/art/design ideas/charter events/2.png and b/art/design ideas/charter events/2.png differ diff --git a/art/github/windows-installation-details.png b/art/github/windows-installation-details.png index 2dfdc61f..5ff9dc19 100644 Binary files a/art/github/windows-installation-details.png and b/art/github/windows-installation-details.png differ diff --git a/art/icon16.png b/art/icon16.png index ecd6730f..2adacd69 100644 Binary files a/art/icon16.png and b/art/icon16.png differ diff --git a/art/icon32.png b/art/icon32.png index 5c6b73e9..f7893863 100644 Binary files a/art/icon32.png and b/art/icon32.png differ diff --git a/art/icon64.png b/art/icon64.png index c0b108c3..8224264c 100644 Binary files a/art/icon64.png and b/art/icon64.png differ diff --git a/art/iconOG.png b/art/iconOG.png index 1a334d66..b0268e51 100644 Binary files a/art/iconOG.png and b/art/iconOG.png differ diff --git a/art/preloaderArt.png b/art/preloaderArt.png index 0d59aeb3..176e51b3 100644 Binary files a/art/preloaderArt.png and b/art/preloaderArt.png differ diff --git a/art/teaser discord.png b/art/teaser discord.png index 56e3e0e4..45fa51ef 100644 Binary files a/art/teaser discord.png and b/art/teaser discord.png differ diff --git a/art/teaser layers/teaser bg.png b/art/teaser layers/teaser bg.png index dd6a21e1..b4e6af05 100644 Binary files a/art/teaser layers/teaser bg.png and b/art/teaser layers/teaser bg.png differ diff --git a/art/teaser layers/teaser checkerboard.png b/art/teaser layers/teaser checkerboard.png index e35aefa6..f515995f 100644 Binary files a/art/teaser layers/teaser checkerboard.png and b/art/teaser layers/teaser checkerboard.png differ diff --git a/art/teaser layers/teaser funkin logo.png b/art/teaser layers/teaser funkin logo.png index 2ddb4a5e..557b740a 100644 Binary files a/art/teaser layers/teaser funkin logo.png and b/art/teaser layers/teaser funkin logo.png differ diff --git a/art/teaser layers/teaser question mark.png b/art/teaser layers/teaser question mark.png index fe36a227..0cbbec86 100644 Binary files a/art/teaser layers/teaser question mark.png and b/art/teaser layers/teaser question mark.png differ diff --git a/art/teaser.png b/art/teaser.png index 4f8712e9..b185f7ac 100644 Binary files a/art/teaser.png and b/art/teaser.png differ diff --git a/art/veryimportant.png b/art/veryimportant.png index bbfb5482..89910647 100644 Binary files a/art/veryimportant.png and b/art/veryimportant.png differ diff --git a/assets/data/characters/pico-speakers.hx b/assets/data/characters/pico-speakers.hx index d59b83f4..67ef39d9 100644 --- a/assets/data/characters/pico-speakers.hx +++ b/assets/data/characters/pico-speakers.hx @@ -14,6 +14,7 @@ function onPlaySingAnim(event) { } function update(elapsed) { - if (getAnimName() == null || (getAnimName().substr(0, 5) == "shoot" && isAnimFinished())) + var animName = getAnimName(); + if (animName == null || (animName.substr(0, 5) == "shoot" && isAnimFinished())) dance(); } \ No newline at end of file diff --git a/assets/images/characters/bf-car.png b/assets/images/characters/bf-car.png index 009da8b6..41d64ad2 100644 Binary files a/assets/images/characters/bf-car.png and b/assets/images/characters/bf-car.png differ diff --git a/assets/images/characters/bf-christmas.png b/assets/images/characters/bf-christmas.png index 8302cb7a..98fc69b9 100644 Binary files a/assets/images/characters/bf-christmas.png and b/assets/images/characters/bf-christmas.png differ diff --git a/assets/images/characters/bf-dead.png b/assets/images/characters/bf-dead.png index 1511d6df..6d129a65 100644 Binary files a/assets/images/characters/bf-dead.png and b/assets/images/characters/bf-dead.png differ diff --git a/assets/images/characters/bf-holding-gf-dead.png b/assets/images/characters/bf-holding-gf-dead.png index 2745d6b8..1d6f3844 100644 Binary files a/assets/images/characters/bf-holding-gf-dead.png and b/assets/images/characters/bf-holding-gf-dead.png differ diff --git a/assets/images/characters/bf-holding-gf.png b/assets/images/characters/bf-holding-gf.png index 78148d8d..0549ae76 100644 Binary files a/assets/images/characters/bf-holding-gf.png and b/assets/images/characters/bf-holding-gf.png differ diff --git a/assets/images/characters/bf-pixel-dead.png b/assets/images/characters/bf-pixel-dead.png index 71c4321e..ddb688a2 100644 Binary files a/assets/images/characters/bf-pixel-dead.png and b/assets/images/characters/bf-pixel-dead.png differ diff --git a/assets/images/characters/bf.png b/assets/images/characters/bf.png index 89896428..2722d1c1 100644 Binary files a/assets/images/characters/bf.png and b/assets/images/characters/bf.png differ diff --git a/assets/images/characters/da.png b/assets/images/characters/da.png index 8ddaf9d4..9a1a2da5 100644 Binary files a/assets/images/characters/da.png and b/assets/images/characters/da.png differ diff --git a/assets/images/characters/dad.png b/assets/images/characters/dad.png index 0782ac7e..cd37de1c 100644 Binary files a/assets/images/characters/dad.png and b/assets/images/characters/dad.png differ diff --git a/assets/images/characters/gf-car/spritemap1.png b/assets/images/characters/gf-car/spritemap1.png index 63afb097..c7f64af5 100644 Binary files a/assets/images/characters/gf-car/spritemap1.png and b/assets/images/characters/gf-car/spritemap1.png differ diff --git a/assets/images/characters/gf-christmas/spritemap1.png b/assets/images/characters/gf-christmas/spritemap1.png index c6897daf..9b28e8ab 100644 Binary files a/assets/images/characters/gf-christmas/spritemap1.png and b/assets/images/characters/gf-christmas/spritemap1.png differ diff --git a/assets/images/characters/gf-pixel.png b/assets/images/characters/gf-pixel.png index 529eb944..fb3d596c 100644 Binary files a/assets/images/characters/gf-pixel.png and b/assets/images/characters/gf-pixel.png differ diff --git a/assets/images/characters/gf-tankmen/spritemap1.png b/assets/images/characters/gf-tankmen/spritemap1.png index f458aa93..7511af39 100644 Binary files a/assets/images/characters/gf-tankmen/spritemap1.png and b/assets/images/characters/gf-tankmen/spritemap1.png differ diff --git a/assets/images/characters/gf/spritemap1.png b/assets/images/characters/gf/spritemap1.png index 2832787e..ac70fc2d 100644 Binary files a/assets/images/characters/gf/spritemap1.png and b/assets/images/characters/gf/spritemap1.png differ diff --git a/assets/images/characters/monster-christmas.png b/assets/images/characters/monster-christmas.png index a46f7bc1..7dd02243 100644 Binary files a/assets/images/characters/monster-christmas.png and b/assets/images/characters/monster-christmas.png differ diff --git a/assets/images/characters/monster.png b/assets/images/characters/monster.png index eb7d2868..451d21b1 100644 Binary files a/assets/images/characters/monster.png and b/assets/images/characters/monster.png differ diff --git a/assets/images/characters/parents-christmas.png b/assets/images/characters/parents-christmas.png index d7adb8b1..e13fee01 100644 Binary files a/assets/images/characters/parents-christmas.png and b/assets/images/characters/parents-christmas.png differ diff --git a/assets/images/characters/pico-speakers/spritemap1.png b/assets/images/characters/pico-speakers/spritemap1.png index 0a6fa8fd..3267cb24 100644 Binary files a/assets/images/characters/pico-speakers/spritemap1.png and b/assets/images/characters/pico-speakers/spritemap1.png differ diff --git a/assets/images/characters/pico.png b/assets/images/characters/pico.png index 3a605f54..12c083d2 100644 Binary files a/assets/images/characters/pico.png and b/assets/images/characters/pico.png differ diff --git a/assets/images/characters/senpai.png b/assets/images/characters/senpai.png index d2d3df2a..fa5a3293 100644 Binary files a/assets/images/characters/senpai.png and b/assets/images/characters/senpai.png differ diff --git a/assets/images/characters/spirit.png b/assets/images/characters/spirit.png index d6cea6fe..c5e84dfb 100644 Binary files a/assets/images/characters/spirit.png and b/assets/images/characters/spirit.png differ diff --git a/assets/images/characters/spooky.png b/assets/images/characters/spooky.png index 568644b6..f941ec2d 100644 Binary files a/assets/images/characters/spooky.png and b/assets/images/characters/spooky.png differ diff --git a/assets/images/characters/tankman.png b/assets/images/characters/tankman.png index b1d4ba66..edfda54a 100644 Binary files a/assets/images/characters/tankman.png and b/assets/images/characters/tankman.png differ diff --git a/assets/images/credits/credit icon example.png b/assets/images/credits/credit icon example.png index 66a717b4..adbf906d 100644 Binary files a/assets/images/credits/credit icon example.png and b/assets/images/credits/credit icon example.png differ diff --git a/assets/images/dialogue/boxes/pixel/dialogueBox.png b/assets/images/dialogue/boxes/pixel/dialogueBox.png index 243669f2..73afeea9 100644 Binary files a/assets/images/dialogue/boxes/pixel/dialogueBox.png and b/assets/images/dialogue/boxes/pixel/dialogueBox.png differ diff --git a/assets/images/dialogue/characters/boyfriend.png b/assets/images/dialogue/characters/boyfriend.png index 61877299..341ba166 100644 Binary files a/assets/images/dialogue/characters/boyfriend.png and b/assets/images/dialogue/characters/boyfriend.png differ diff --git a/assets/images/dialogue/characters/dad.png b/assets/images/dialogue/characters/dad.png index 1580867d..de81cf3c 100644 Binary files a/assets/images/dialogue/characters/dad.png and b/assets/images/dialogue/characters/dad.png differ diff --git a/assets/images/dialogue/characters/niko.png b/assets/images/dialogue/characters/niko.png index 3131de36..81acec6e 100644 Binary files a/assets/images/dialogue/characters/niko.png and b/assets/images/dialogue/characters/niko.png differ diff --git a/assets/images/dialogue/characters/pixel/boyfriend.png b/assets/images/dialogue/characters/pixel/boyfriend.png index 2756eaf0..d5b342c5 100644 Binary files a/assets/images/dialogue/characters/pixel/boyfriend.png and b/assets/images/dialogue/characters/pixel/boyfriend.png differ diff --git a/assets/images/dialogue/characters/pixel/senpai.png b/assets/images/dialogue/characters/pixel/senpai.png index 35c05514..917b21be 100644 Binary files a/assets/images/dialogue/characters/pixel/senpai.png and b/assets/images/dialogue/characters/pixel/senpai.png differ diff --git a/assets/images/editors/autosave-delete.png b/assets/images/editors/autosave-delete.png index 2de6cbad..18ab7de0 100644 Binary files a/assets/images/editors/autosave-delete.png and b/assets/images/editors/autosave-delete.png differ diff --git a/assets/images/editors/autosave-icons.png b/assets/images/editors/autosave-icons.png index 03edceba..26f99bc2 100644 Binary files a/assets/images/editors/autosave-icons.png and b/assets/images/editors/autosave-icons.png differ diff --git a/assets/images/editors/bgs/charter.png b/assets/images/editors/bgs/charter.png index c3ce716d..e1a6f93a 100644 Binary files a/assets/images/editors/bgs/charter.png and b/assets/images/editors/bgs/charter.png differ diff --git a/assets/images/editors/character/WOAH.png b/assets/images/editors/character/WOAH.png index 13d95d50..8821bc1d 100644 Binary files a/assets/images/editors/character/WOAH.png and b/assets/images/editors/character/WOAH.png differ diff --git a/assets/images/editors/charter/add-button.png b/assets/images/editors/charter/add-button.png index ff942a42..906d8ca3 100644 Binary files a/assets/images/editors/charter/add-button.png and b/assets/images/editors/charter/add-button.png differ diff --git a/assets/images/editors/charter/event-icons/Add Camera Zoom.png b/assets/images/editors/charter/event-icons/Add Camera Zoom.png index e8657597..48ce845c 100644 Binary files a/assets/images/editors/charter/event-icons/Add Camera Zoom.png and b/assets/images/editors/charter/event-icons/Add Camera Zoom.png differ diff --git a/assets/images/editors/charter/event-icons/Alt Animation Toggle.png b/assets/images/editors/charter/event-icons/Alt Animation Toggle.png index ce2e8e3b..e982158a 100644 Binary files a/assets/images/editors/charter/event-icons/Alt Animation Toggle.png and b/assets/images/editors/charter/event-icons/Alt Animation Toggle.png differ diff --git a/assets/images/editors/charter/event-icons/BPM Change.png b/assets/images/editors/charter/event-icons/BPM Change.png index a59fe83a..b95e0d36 100644 Binary files a/assets/images/editors/charter/event-icons/BPM Change.png and b/assets/images/editors/charter/event-icons/BPM Change.png differ diff --git a/assets/images/editors/charter/event-icons/Camera Flash.png b/assets/images/editors/charter/event-icons/Camera Flash.png index 367e66e2..22903bea 100644 Binary files a/assets/images/editors/charter/event-icons/Camera Flash.png and b/assets/images/editors/charter/event-icons/Camera Flash.png differ diff --git a/assets/images/editors/charter/event-icons/Camera Modulo Change.png b/assets/images/editors/charter/event-icons/Camera Modulo Change.png index 761a6be5..5eb5f064 100644 Binary files a/assets/images/editors/charter/event-icons/Camera Modulo Change.png and b/assets/images/editors/charter/event-icons/Camera Modulo Change.png differ diff --git a/assets/images/editors/charter/event-icons/Camera Movement.png b/assets/images/editors/charter/event-icons/Camera Movement.png index de8ce042..3126c502 100644 Binary files a/assets/images/editors/charter/event-icons/Camera Movement.png and b/assets/images/editors/charter/event-icons/Camera Movement.png differ diff --git a/assets/images/editors/charter/event-icons/HScript Call.png b/assets/images/editors/charter/event-icons/HScript Call.png index ab2ff5e1..5aa4095a 100644 Binary files a/assets/images/editors/charter/event-icons/HScript Call.png and b/assets/images/editors/charter/event-icons/HScript Call.png differ diff --git a/assets/images/editors/charter/event-icons/Play Animation.png b/assets/images/editors/charter/event-icons/Play Animation.png index 096966a6..1092f05f 100644 Binary files a/assets/images/editors/charter/event-icons/Play Animation.png and b/assets/images/editors/charter/event-icons/Play Animation.png differ diff --git a/assets/images/editors/charter/event-icons/Scroll Speed Change.png b/assets/images/editors/charter/event-icons/Scroll Speed Change.png index 924f9484..4b06071c 100644 Binary files a/assets/images/editors/charter/event-icons/Scroll Speed Change.png and b/assets/images/editors/charter/event-icons/Scroll Speed Change.png differ diff --git a/assets/images/editors/charter/event-icons/Unknown.png b/assets/images/editors/charter/event-icons/Unknown.png index 6d717e79..26ac16c6 100644 Binary files a/assets/images/editors/charter/event-icons/Unknown.png and b/assets/images/editors/charter/event-icons/Unknown.png differ diff --git a/assets/images/editors/charter/event-spr-add.png b/assets/images/editors/charter/event-spr-add.png index 034433d8..21cc06d9 100644 Binary files a/assets/images/editors/charter/event-spr-add.png and b/assets/images/editors/charter/event-spr-add.png differ diff --git a/assets/images/editors/charter/event-spr.png b/assets/images/editors/charter/event-spr.png index 17f15d56..45149581 100644 Binary files a/assets/images/editors/charter/event-spr.png and b/assets/images/editors/charter/event-spr.png differ diff --git a/assets/images/editors/charter/event.png b/assets/images/editors/charter/event.png index 95f7e2d2..8fe12787 100644 Binary files a/assets/images/editors/charter/event.png and b/assets/images/editors/charter/event.png differ diff --git a/assets/images/editors/charter/events-grid.png b/assets/images/editors/charter/events-grid.png index 335e2fce..3a4f90e6 100644 Binary files a/assets/images/editors/charter/events-grid.png and b/assets/images/editors/charter/events-grid.png differ diff --git a/assets/images/editors/charter/lock-strumline.png b/assets/images/editors/charter/lock-strumline.png index 5c5ff017..637e5f64 100644 Binary files a/assets/images/editors/charter/lock-strumline.png and b/assets/images/editors/charter/lock-strumline.png differ diff --git a/assets/images/editors/charter/note.png b/assets/images/editors/charter/note.png index c30bc664..f567f4c5 100644 Binary files a/assets/images/editors/charter/note.png and b/assets/images/editors/charter/note.png differ diff --git a/assets/images/editors/charter/strumline-info-bg.png b/assets/images/editors/charter/strumline-info-bg.png index 5d073dbc..74d7d906 100644 Binary files a/assets/images/editors/charter/strumline-info-bg.png and b/assets/images/editors/charter/strumline-info-bg.png differ diff --git a/assets/images/editors/delete-button.png b/assets/images/editors/delete-button.png index 0bf75235..4a80427c 100644 Binary files a/assets/images/editors/delete-button.png and b/assets/images/editors/delete-button.png differ diff --git a/assets/images/editors/deleter circle.png b/assets/images/editors/deleter circle.png index 7d63d069..c4120b13 100644 Binary files a/assets/images/editors/deleter circle.png and b/assets/images/editors/deleter circle.png differ diff --git a/assets/images/editors/deleter.png b/assets/images/editors/deleter.png index 8146955d..c3c39bcc 100644 Binary files a/assets/images/editors/deleter.png and b/assets/images/editors/deleter.png differ diff --git a/assets/images/editors/icons.png b/assets/images/editors/icons.png index b19a7f68..41dee63c 100644 Binary files a/assets/images/editors/icons.png and b/assets/images/editors/icons.png differ diff --git a/assets/images/editors/new.png b/assets/images/editors/new.png index 9db3dd59..461fd2ea 100644 Binary files a/assets/images/editors/new.png and b/assets/images/editors/new.png differ diff --git a/assets/images/editors/ui/audio-buttons.png b/assets/images/editors/ui/audio-buttons.png index be968ca1..6bd347a8 100644 Binary files a/assets/images/editors/ui/audio-buttons.png and b/assets/images/editors/ui/audio-buttons.png differ diff --git a/assets/images/editors/ui/audio-icon.png b/assets/images/editors/ui/audio-icon.png index 9944066f..97eb7763 100644 Binary files a/assets/images/editors/ui/audio-icon.png and b/assets/images/editors/ui/audio-icon.png differ diff --git a/assets/images/editors/ui/audio-time-empty.png b/assets/images/editors/ui/audio-time-empty.png index 906370dc..b08c0154 100644 Binary files a/assets/images/editors/ui/audio-time-empty.png and b/assets/images/editors/ui/audio-time-empty.png differ diff --git a/assets/images/editors/ui/audio-time-full.png b/assets/images/editors/ui/audio-time-full.png index bc3c46d3..85c4e77c 100644 Binary files a/assets/images/editors/ui/audio-time-full.png and b/assets/images/editors/ui/audio-time-full.png differ diff --git a/assets/images/editors/ui/audio-volume-empty.png b/assets/images/editors/ui/audio-volume-empty.png index db307153..290f8099 100644 Binary files a/assets/images/editors/ui/audio-volume-empty.png and b/assets/images/editors/ui/audio-volume-empty.png differ diff --git a/assets/images/editors/ui/audio-volume-full.png b/assets/images/editors/ui/audio-volume-full.png index a0d75ebe..eebab268 100644 Binary files a/assets/images/editors/ui/audio-volume-full.png and b/assets/images/editors/ui/audio-volume-full.png differ diff --git a/assets/images/editors/ui/button.png b/assets/images/editors/ui/button.png index 9b0a33e4..dc270bee 100644 Binary files a/assets/images/editors/ui/button.png and b/assets/images/editors/ui/button.png differ diff --git a/assets/images/editors/ui/checkbox.png b/assets/images/editors/ui/checkbox.png index b297a7a7..95ef7ccb 100644 Binary files a/assets/images/editors/ui/checkbox.png and b/assets/images/editors/ui/checkbox.png differ diff --git a/assets/images/editors/ui/context-bg.png b/assets/images/editors/ui/context-bg.png index 757ccfc1..4e46b537 100644 Binary files a/assets/images/editors/ui/context-bg.png and b/assets/images/editors/ui/context-bg.png differ diff --git a/assets/images/editors/ui/context-icons.png b/assets/images/editors/ui/context-icons.png index a9de6358..733a8523 100644 Binary files a/assets/images/editors/ui/context-icons.png and b/assets/images/editors/ui/context-icons.png differ diff --git a/assets/images/editors/ui/grayscale-button.png b/assets/images/editors/ui/grayscale-button.png index 1467fece..1ae568f9 100644 Binary files a/assets/images/editors/ui/grayscale-button.png and b/assets/images/editors/ui/grayscale-button.png differ diff --git a/assets/images/editors/ui/grayscale-popup.png b/assets/images/editors/ui/grayscale-popup.png index b0113603..1bd1b240 100644 Binary files a/assets/images/editors/ui/grayscale-popup.png and b/assets/images/editors/ui/grayscale-popup.png differ diff --git a/assets/images/editors/ui/inputbox.png b/assets/images/editors/ui/inputbox.png index 229df739..f3b1df34 100644 Binary files a/assets/images/editors/ui/inputbox.png and b/assets/images/editors/ui/inputbox.png differ diff --git a/assets/images/editors/ui/menu-item.png b/assets/images/editors/ui/menu-item.png index 58a7b72f..5babc03a 100644 Binary files a/assets/images/editors/ui/menu-item.png and b/assets/images/editors/ui/menu-item.png differ diff --git a/assets/images/editors/ui/normal-popup.png b/assets/images/editors/ui/normal-popup.png index f0f00305..1227df6d 100644 Binary files a/assets/images/editors/ui/normal-popup.png and b/assets/images/editors/ui/normal-popup.png differ diff --git a/assets/images/editors/ui/radiobutton.png b/assets/images/editors/ui/radiobutton.png index a6f7dbce..56c26c15 100644 Binary files a/assets/images/editors/ui/radiobutton.png and b/assets/images/editors/ui/radiobutton.png differ diff --git a/assets/images/editors/ui/scrollbar-bg.png b/assets/images/editors/ui/scrollbar-bg.png index 1c6547a7..1f49a24a 100644 Binary files a/assets/images/editors/ui/scrollbar-bg.png and b/assets/images/editors/ui/scrollbar-bg.png differ diff --git a/assets/images/editors/ui/scrollbar-icon.png b/assets/images/editors/ui/scrollbar-icon.png index deca2617..f2a5c0ec 100644 Binary files a/assets/images/editors/ui/scrollbar-icon.png and b/assets/images/editors/ui/scrollbar-icon.png differ diff --git a/assets/images/editors/ui/scrollbar.png b/assets/images/editors/ui/scrollbar.png index 0ed65abe..f63152f4 100644 Binary files a/assets/images/editors/ui/scrollbar.png and b/assets/images/editors/ui/scrollbar.png differ diff --git a/assets/images/editors/ui/selection.png b/assets/images/editors/ui/selection.png index 09297449..456897fe 100644 Binary files a/assets/images/editors/ui/selection.png and b/assets/images/editors/ui/selection.png differ diff --git a/assets/images/editors/ui/slider.png b/assets/images/editors/ui/slider.png index 5cbaf969..82b6c80b 100644 Binary files a/assets/images/editors/ui/slider.png and b/assets/images/editors/ui/slider.png differ diff --git a/assets/images/editors/ui/textbox.png b/assets/images/editors/ui/textbox.png index c208d07c..a66637a4 100644 Binary files a/assets/images/editors/ui/textbox.png and b/assets/images/editors/ui/textbox.png differ diff --git a/assets/images/editors/ui/topmenu.png b/assets/images/editors/ui/topmenu.png index e45f18c1..4f010db4 100644 Binary files a/assets/images/editors/ui/topmenu.png and b/assets/images/editors/ui/topmenu.png differ diff --git a/assets/images/editors/ui/upload-button.png b/assets/images/editors/ui/upload-button.png index 6993f74f..bfdba151 100644 Binary files a/assets/images/editors/ui/upload-button.png and b/assets/images/editors/ui/upload-button.png differ diff --git a/assets/images/editors/warnings/error.png b/assets/images/editors/warnings/error.png index 30f4d595..07282f8b 100644 Binary files a/assets/images/editors/warnings/error.png and b/assets/images/editors/warnings/error.png differ diff --git a/assets/images/editors/warnings/warning.png b/assets/images/editors/warnings/warning.png index 02546340..1d501046 100644 Binary files a/assets/images/editors/warnings/warning.png and b/assets/images/editors/warnings/warning.png differ diff --git a/assets/images/game/cutscenes/tank/guns-tankman/spritemap1.png b/assets/images/game/cutscenes/tank/guns-tankman/spritemap1.png index 76007fd8..337491b6 100644 Binary files a/assets/images/game/cutscenes/tank/guns-tankman/spritemap1.png and b/assets/images/game/cutscenes/tank/guns-tankman/spritemap1.png differ diff --git a/assets/images/game/cutscenes/tank/stress-pico/spritemap1.png b/assets/images/game/cutscenes/tank/stress-pico/spritemap1.png index 07ca290c..ff06b73f 100644 Binary files a/assets/images/game/cutscenes/tank/stress-pico/spritemap1.png and b/assets/images/game/cutscenes/tank/stress-pico/spritemap1.png differ diff --git a/assets/images/game/cutscenes/tank/stress-tankman/spritemap1.png b/assets/images/game/cutscenes/tank/stress-tankman/spritemap1.png index b7f6b5ff..7ed88503 100644 Binary files a/assets/images/game/cutscenes/tank/stress-tankman/spritemap1.png and b/assets/images/game/cutscenes/tank/stress-tankman/spritemap1.png differ diff --git a/assets/images/game/cutscenes/tank/ugh-tankman/spritemap1.png b/assets/images/game/cutscenes/tank/ugh-tankman/spritemap1.png index 5671b093..957cae53 100644 Binary files a/assets/images/game/cutscenes/tank/ugh-tankman/spritemap1.png and b/assets/images/game/cutscenes/tank/ugh-tankman/spritemap1.png differ diff --git a/assets/images/game/cutscenes/weeb/senpaiCrazy.png b/assets/images/game/cutscenes/weeb/senpaiCrazy.png index 43989202..1091f92a 100644 Binary files a/assets/images/game/cutscenes/weeb/senpaiCrazy.png and b/assets/images/game/cutscenes/weeb/senpaiCrazy.png differ diff --git a/assets/images/game/cutscenes/weeb/spiritFaceForward.png b/assets/images/game/cutscenes/weeb/spiritFaceForward.png index 48fc9448..93c7ed04 100644 Binary files a/assets/images/game/cutscenes/weeb/spiritFaceForward.png and b/assets/images/game/cutscenes/weeb/spiritFaceForward.png differ diff --git a/assets/images/game/go.png b/assets/images/game/go.png index 9967baf5..78cc7f68 100644 Binary files a/assets/images/game/go.png and b/assets/images/game/go.png differ diff --git a/assets/images/game/healthBar.png b/assets/images/game/healthBar.png index 6851c28e..8bfec941 100644 Binary files a/assets/images/game/healthBar.png and b/assets/images/game/healthBar.png differ diff --git a/assets/images/game/notes/default.png b/assets/images/game/notes/default.png index 34b40f7f..6cd38f99 100644 Binary files a/assets/images/game/notes/default.png and b/assets/images/game/notes/default.png differ diff --git a/assets/images/game/restart.png b/assets/images/game/restart.png index 04d52844..82c210d0 100644 Binary files a/assets/images/game/restart.png and b/assets/images/game/restart.png differ diff --git a/assets/images/game/score/bad.png b/assets/images/game/score/bad.png index 74af825b..7b7c7398 100644 Binary files a/assets/images/game/score/bad.png and b/assets/images/game/score/bad.png differ diff --git a/assets/images/game/score/combo.png b/assets/images/game/score/combo.png index ec158e36..ffc94f44 100644 Binary files a/assets/images/game/score/combo.png and b/assets/images/game/score/combo.png differ diff --git a/assets/images/game/score/good.png b/assets/images/game/score/good.png index ea9f6d6f..d6c8f386 100644 Binary files a/assets/images/game/score/good.png and b/assets/images/game/score/good.png differ diff --git a/assets/images/game/score/num0.png b/assets/images/game/score/num0.png index 97958e6a..83958371 100644 Binary files a/assets/images/game/score/num0.png and b/assets/images/game/score/num0.png differ diff --git a/assets/images/game/score/num1.png b/assets/images/game/score/num1.png index 10cf69da..52452ae1 100644 Binary files a/assets/images/game/score/num1.png and b/assets/images/game/score/num1.png differ diff --git a/assets/images/game/score/num2.png b/assets/images/game/score/num2.png index 9f4ff37a..2db35d5b 100644 Binary files a/assets/images/game/score/num2.png and b/assets/images/game/score/num2.png differ diff --git a/assets/images/game/score/num3.png b/assets/images/game/score/num3.png index c01bd739..a6b32303 100644 Binary files a/assets/images/game/score/num3.png and b/assets/images/game/score/num3.png differ diff --git a/assets/images/game/score/num4.png b/assets/images/game/score/num4.png index 2e4786f1..24f99bda 100644 Binary files a/assets/images/game/score/num4.png and b/assets/images/game/score/num4.png differ diff --git a/assets/images/game/score/num5.png b/assets/images/game/score/num5.png index 32ea82df..542423eb 100644 Binary files a/assets/images/game/score/num5.png and b/assets/images/game/score/num5.png differ diff --git a/assets/images/game/score/num6.png b/assets/images/game/score/num6.png index bd8f0a31..c6044194 100644 Binary files a/assets/images/game/score/num6.png and b/assets/images/game/score/num6.png differ diff --git a/assets/images/game/score/num7.png b/assets/images/game/score/num7.png index 6568afc3..8b2d5498 100644 Binary files a/assets/images/game/score/num7.png and b/assets/images/game/score/num7.png differ diff --git a/assets/images/game/score/num8.png b/assets/images/game/score/num8.png index 9c867aed..db61c3e9 100644 Binary files a/assets/images/game/score/num8.png and b/assets/images/game/score/num8.png differ diff --git a/assets/images/game/score/num9.png b/assets/images/game/score/num9.png index bd892121..607f9ea7 100644 Binary files a/assets/images/game/score/num9.png and b/assets/images/game/score/num9.png differ diff --git a/assets/images/game/score/shit.png b/assets/images/game/score/shit.png index 2f174f4b..346141ad 100644 Binary files a/assets/images/game/score/shit.png and b/assets/images/game/score/shit.png differ diff --git a/assets/images/game/score/sick.png b/assets/images/game/score/sick.png index e20bdff3..5cbba1e2 100644 Binary files a/assets/images/game/score/sick.png and b/assets/images/game/score/sick.png differ diff --git a/assets/images/game/splashes/default.png b/assets/images/game/splashes/default.png index d3b03ceb..e93fdcb7 100644 Binary files a/assets/images/game/splashes/default.png and b/assets/images/game/splashes/default.png differ diff --git a/assets/images/game/splashes/secret.png b/assets/images/game/splashes/secret.png index e8251369..f0eccb47 100644 Binary files a/assets/images/game/splashes/secret.png and b/assets/images/game/splashes/secret.png differ diff --git a/assets/images/icons/bf-old.png b/assets/images/icons/bf-old.png index 132b5716..b8369aca 100644 Binary files a/assets/images/icons/bf-old.png and b/assets/images/icons/bf-old.png differ diff --git a/assets/images/icons/bf-pixel.png b/assets/images/icons/bf-pixel.png index 67ebdc7e..1351f810 100644 Binary files a/assets/images/icons/bf-pixel.png and b/assets/images/icons/bf-pixel.png differ diff --git a/assets/images/icons/bf.png b/assets/images/icons/bf.png index 9ea4a5a3..ab0903a7 100644 Binary files a/assets/images/icons/bf.png and b/assets/images/icons/bf.png differ diff --git a/assets/images/icons/dad.png b/assets/images/icons/dad.png index 62e052ab..ffdf4ac1 100644 Binary files a/assets/images/icons/dad.png and b/assets/images/icons/dad.png differ diff --git a/assets/images/icons/face.png b/assets/images/icons/face.png index f8af979d..622eb6dc 100644 Binary files a/assets/images/icons/face.png and b/assets/images/icons/face.png differ diff --git a/assets/images/icons/gf-pixel.png b/assets/images/icons/gf-pixel.png index c3e36293..5122ddc0 100644 Binary files a/assets/images/icons/gf-pixel.png and b/assets/images/icons/gf-pixel.png differ diff --git a/assets/images/icons/gf.png b/assets/images/icons/gf.png index d3256ea8..ee837c1d 100644 Binary files a/assets/images/icons/gf.png and b/assets/images/icons/gf.png differ diff --git a/assets/images/icons/mom.png b/assets/images/icons/mom.png index cb64d017..1179e39b 100644 Binary files a/assets/images/icons/mom.png and b/assets/images/icons/mom.png differ diff --git a/assets/images/icons/monster.png b/assets/images/icons/monster.png index 4ba11771..a7195ca3 100644 Binary files a/assets/images/icons/monster.png and b/assets/images/icons/monster.png differ diff --git a/assets/images/icons/parents-christmas.png b/assets/images/icons/parents-christmas.png index 06aa612a..64efb7fd 100644 Binary files a/assets/images/icons/parents-christmas.png and b/assets/images/icons/parents-christmas.png differ diff --git a/assets/images/icons/pico.png b/assets/images/icons/pico.png index fe349099..c159e236 100644 Binary files a/assets/images/icons/pico.png and b/assets/images/icons/pico.png differ diff --git a/assets/images/icons/senpai.png b/assets/images/icons/senpai.png index 9257f64c..22d0881b 100644 Binary files a/assets/images/icons/senpai.png and b/assets/images/icons/senpai.png differ diff --git a/assets/images/icons/spirit.png b/assets/images/icons/spirit.png index a163b8c3..c4ccb2a9 100644 Binary files a/assets/images/icons/spirit.png and b/assets/images/icons/spirit.png differ diff --git a/assets/images/icons/spooky.png b/assets/images/icons/spooky.png index e5b3964f..062eb196 100644 Binary files a/assets/images/icons/spooky.png and b/assets/images/icons/spooky.png differ diff --git a/assets/images/icons/tankman.png b/assets/images/icons/tankman.png index 873e5270..d5d4ba46 100644 Binary files a/assets/images/icons/tankman.png and b/assets/images/icons/tankman.png differ diff --git a/assets/images/menus/alphabet-bold.png b/assets/images/menus/alphabet-bold.png index d79ba644..012721ce 100644 Binary files a/assets/images/menus/alphabet-bold.png and b/assets/images/menus/alphabet-bold.png differ diff --git a/assets/images/menus/mainmenu/donate.png b/assets/images/menus/mainmenu/donate.png index 873baa07..e4a42749 100644 Binary files a/assets/images/menus/mainmenu/donate.png and b/assets/images/menus/mainmenu/donate.png differ diff --git a/assets/images/menus/mainmenu/freeplay.png b/assets/images/menus/mainmenu/freeplay.png index 255b701f..a34eed2e 100644 Binary files a/assets/images/menus/mainmenu/freeplay.png and b/assets/images/menus/mainmenu/freeplay.png differ diff --git a/assets/images/menus/mainmenu/options.png b/assets/images/menus/mainmenu/options.png index 7c8df8ff..ebe1f86f 100644 Binary files a/assets/images/menus/mainmenu/options.png and b/assets/images/menus/mainmenu/options.png differ diff --git a/assets/images/menus/mainmenu/story mode.png b/assets/images/menus/mainmenu/story mode.png index c534bf60..162f403d 100644 Binary files a/assets/images/menus/mainmenu/story mode.png and b/assets/images/menus/mainmenu/story mode.png differ diff --git a/assets/images/menus/menuBG.png b/assets/images/menus/menuBG.png index ebc095a9..35458e80 100644 Binary files a/assets/images/menus/menuBG.png and b/assets/images/menus/menuBG.png differ diff --git a/assets/images/menus/menuBGBlue.png b/assets/images/menus/menuBGBlue.png index 1d12db0f..d3b42842 100644 Binary files a/assets/images/menus/menuBGBlue.png and b/assets/images/menus/menuBGBlue.png differ diff --git a/assets/images/menus/menuBGMagenta.png b/assets/images/menus/menuBGMagenta.png index 0324d422..96794ec8 100644 Binary files a/assets/images/menus/menuBGMagenta.png and b/assets/images/menus/menuBGMagenta.png differ diff --git a/assets/images/menus/menuContrast.png b/assets/images/menus/menuContrast.png index 6382375f..38874330 100644 Binary files a/assets/images/menus/menuContrast.png and b/assets/images/menus/menuContrast.png differ diff --git a/assets/images/menus/menuDesat.png b/assets/images/menus/menuDesat.png index d5c2941f..65759840 100644 Binary files a/assets/images/menus/menuDesat.png and b/assets/images/menus/menuDesat.png differ diff --git a/assets/images/menus/menuEditors.png b/assets/images/menus/menuEditors.png index a34c46e2..d6afefd1 100644 Binary files a/assets/images/menus/menuEditors.png and b/assets/images/menus/menuEditors.png differ diff --git a/assets/images/menus/options/checkboxThingie.png b/assets/images/menus/options/checkboxThingie.png index 16c238fd..ffdf3d30 100644 Binary files a/assets/images/menus/options/checkboxThingie.png and b/assets/images/menus/options/checkboxThingie.png differ diff --git a/assets/images/menus/pauseAlt/bfLol.png b/assets/images/menus/pauseAlt/bfLol.png index f53bcbe2..bfbdb86a 100644 Binary files a/assets/images/menus/pauseAlt/bfLol.png and b/assets/images/menus/pauseAlt/bfLol.png differ diff --git a/assets/images/menus/pauseAlt/pauseBG.png b/assets/images/menus/pauseAlt/pauseBG.png index 2c5c0c61..5b5a77c6 100644 Binary files a/assets/images/menus/pauseAlt/pauseBG.png and b/assets/images/menus/pauseAlt/pauseBG.png differ diff --git a/assets/images/menus/pauseAlt/pauseUI.png b/assets/images/menus/pauseAlt/pauseUI.png index 63f1e62a..b395863b 100644 Binary files a/assets/images/menus/pauseAlt/pauseUI.png and b/assets/images/menus/pauseAlt/pauseUI.png differ diff --git a/assets/images/menus/storymenu/assets.png b/assets/images/menus/storymenu/assets.png index 4d0720dd..914229b6 100644 Binary files a/assets/images/menus/storymenu/assets.png and b/assets/images/menus/storymenu/assets.png differ diff --git a/assets/images/menus/storymenu/characters/bf.png b/assets/images/menus/storymenu/characters/bf.png index d557828e..74713c3d 100644 Binary files a/assets/images/menus/storymenu/characters/bf.png and b/assets/images/menus/storymenu/characters/bf.png differ diff --git a/assets/images/menus/storymenu/characters/dad.png b/assets/images/menus/storymenu/characters/dad.png index ad8e5f7e..d63e4537 100644 Binary files a/assets/images/menus/storymenu/characters/dad.png and b/assets/images/menus/storymenu/characters/dad.png differ diff --git a/assets/images/menus/storymenu/characters/gf.png b/assets/images/menus/storymenu/characters/gf.png index b53b5abe..8ad08471 100644 Binary files a/assets/images/menus/storymenu/characters/gf.png and b/assets/images/menus/storymenu/characters/gf.png differ diff --git a/assets/images/menus/storymenu/characters/parents-christmas.png b/assets/images/menus/storymenu/characters/parents-christmas.png index 3773fe56..7f081ede 100644 Binary files a/assets/images/menus/storymenu/characters/parents-christmas.png and b/assets/images/menus/storymenu/characters/parents-christmas.png differ diff --git a/assets/images/menus/storymenu/characters/pico.png b/assets/images/menus/storymenu/characters/pico.png index fbce6964..46a4e375 100644 Binary files a/assets/images/menus/storymenu/characters/pico.png and b/assets/images/menus/storymenu/characters/pico.png differ diff --git a/assets/images/menus/storymenu/characters/senpai.png b/assets/images/menus/storymenu/characters/senpai.png index f63ddd77..8fe57d22 100644 Binary files a/assets/images/menus/storymenu/characters/senpai.png and b/assets/images/menus/storymenu/characters/senpai.png differ diff --git a/assets/images/menus/storymenu/characters/spooky.png b/assets/images/menus/storymenu/characters/spooky.png index 1272f5da..e9bc3a15 100644 Binary files a/assets/images/menus/storymenu/characters/spooky.png and b/assets/images/menus/storymenu/characters/spooky.png differ diff --git a/assets/images/menus/storymenu/characters/tankman.png b/assets/images/menus/storymenu/characters/tankman.png index 6079b33d..26f26dca 100644 Binary files a/assets/images/menus/storymenu/characters/tankman.png and b/assets/images/menus/storymenu/characters/tankman.png differ diff --git a/assets/images/menus/storymenu/difficulties/easy.png b/assets/images/menus/storymenu/difficulties/easy.png index c5c3e4e1..e73783ad 100644 Binary files a/assets/images/menus/storymenu/difficulties/easy.png and b/assets/images/menus/storymenu/difficulties/easy.png differ diff --git a/assets/images/menus/storymenu/difficulties/normal.png b/assets/images/menus/storymenu/difficulties/normal.png index ff9bdea4..8acd14e9 100644 Binary files a/assets/images/menus/storymenu/difficulties/normal.png and b/assets/images/menus/storymenu/difficulties/normal.png differ diff --git a/assets/images/menus/storymenu/weeks/week2.png b/assets/images/menus/storymenu/weeks/week2.png index a5791538..0b76c032 100644 Binary files a/assets/images/menus/storymenu/weeks/week2.png and b/assets/images/menus/storymenu/weeks/week2.png differ diff --git a/assets/images/menus/storymenu/weeks/week4.png b/assets/images/menus/storymenu/weeks/week4.png index b25ad5e0..7122f979 100644 Binary files a/assets/images/menus/storymenu/weeks/week4.png and b/assets/images/menus/storymenu/weeks/week4.png differ diff --git a/assets/images/menus/storymenu/weeks/week5.png b/assets/images/menus/storymenu/weeks/week5.png index 3b8605d0..1a3a02a8 100644 Binary files a/assets/images/menus/storymenu/weeks/week5.png and b/assets/images/menus/storymenu/weeks/week5.png differ diff --git a/assets/images/menus/storymenu/weeks/week6.png b/assets/images/menus/storymenu/weeks/week6.png index 432cd7f8..0e02a8b1 100644 Binary files a/assets/images/menus/storymenu/weeks/week6.png and b/assets/images/menus/storymenu/weeks/week6.png differ diff --git a/assets/images/menus/titlescreen/newgrounds_logo.png b/assets/images/menus/titlescreen/newgrounds_logo.png index 203290b6..26948b66 100644 Binary files a/assets/images/menus/titlescreen/newgrounds_logo.png and b/assets/images/menus/titlescreen/newgrounds_logo.png differ diff --git a/assets/images/menus/titlescreen/titleEnter.png b/assets/images/menus/titlescreen/titleEnter.png index 38d6fab9..ad1a9f5f 100644 Binary files a/assets/images/menus/titlescreen/titleEnter.png and b/assets/images/menus/titlescreen/titleEnter.png differ diff --git a/assets/images/menus/transitionSpr.png b/assets/images/menus/transitionSpr.png index 7950267f..0044c064 100644 Binary files a/assets/images/menus/transitionSpr.png and b/assets/images/menus/transitionSpr.png differ diff --git a/assets/images/menus/update/bf.png b/assets/images/menus/update/bf.png index c9d6a6fc..975f3d1a 100644 Binary files a/assets/images/menus/update/bf.png and b/assets/images/menus/update/bf.png differ diff --git a/assets/images/stages/default/stage_light.png b/assets/images/stages/default/stage_light.png index 7775ff8f..b33f6d60 100644 Binary files a/assets/images/stages/default/stage_light.png and b/assets/images/stages/default/stage_light.png differ diff --git a/assets/images/stages/default/stagecurtains.png b/assets/images/stages/default/stagecurtains.png index 62cc0b23..de33c06e 100644 Binary files a/assets/images/stages/default/stagecurtains.png and b/assets/images/stages/default/stagecurtains.png differ diff --git a/assets/images/stages/limo/bgLimo.png b/assets/images/stages/limo/bgLimo.png index 17ba1920..579862d0 100644 Binary files a/assets/images/stages/limo/bgLimo.png and b/assets/images/stages/limo/bgLimo.png differ diff --git a/assets/images/stages/limo/dumb.png b/assets/images/stages/limo/dumb.png index 0805a390..25ea6651 100644 Binary files a/assets/images/stages/limo/dumb.png and b/assets/images/stages/limo/dumb.png differ diff --git a/assets/images/stages/limo/fastCarLol.png b/assets/images/stages/limo/fastCarLol.png index bc30e71d..392bc8e4 100644 Binary files a/assets/images/stages/limo/fastCarLol.png and b/assets/images/stages/limo/fastCarLol.png differ diff --git a/assets/images/stages/limo/limoDrive.png b/assets/images/stages/limo/limoDrive.png index f547b9a2..7ba8dd90 100644 Binary files a/assets/images/stages/limo/limoDrive.png and b/assets/images/stages/limo/limoDrive.png differ diff --git a/assets/images/stages/limo/limoOverlay.png b/assets/images/stages/limo/limoOverlay.png index 6c90bec2..24ede11c 100644 Binary files a/assets/images/stages/limo/limoOverlay.png and b/assets/images/stages/limo/limoOverlay.png differ diff --git a/assets/images/stages/limo/limoSunset.png b/assets/images/stages/limo/limoSunset.png index 144714e9..dddf07b2 100644 Binary files a/assets/images/stages/limo/limoSunset.png and b/assets/images/stages/limo/limoSunset.png differ diff --git a/assets/images/stages/mall/bgEscalator.png b/assets/images/stages/mall/bgEscalator.png index 7496e581..8cff7edf 100644 Binary files a/assets/images/stages/mall/bgEscalator.png and b/assets/images/stages/mall/bgEscalator.png differ diff --git a/assets/images/stages/mall/bgWalls.png b/assets/images/stages/mall/bgWalls.png index 3596d42f..0222b8cf 100644 Binary files a/assets/images/stages/mall/bgWalls.png and b/assets/images/stages/mall/bgWalls.png differ diff --git a/assets/images/stages/mall/bottomBop.png b/assets/images/stages/mall/bottomBop.png index a687f3c5..d952e8e8 100644 Binary files a/assets/images/stages/mall/bottomBop.png and b/assets/images/stages/mall/bottomBop.png differ diff --git a/assets/images/stages/mall/christmasTree.png b/assets/images/stages/mall/christmasTree.png index 7eff4f42..0d7413d7 100644 Binary files a/assets/images/stages/mall/christmasTree.png and b/assets/images/stages/mall/christmasTree.png differ diff --git a/assets/images/stages/mall/christmasWall.png b/assets/images/stages/mall/christmasWall.png index 54489d6d..0ac5c218 100644 Binary files a/assets/images/stages/mall/christmasWall.png and b/assets/images/stages/mall/christmasWall.png differ diff --git a/assets/images/stages/mall/evilBG.png b/assets/images/stages/mall/evilBG.png index 27d33fec..ea087576 100644 Binary files a/assets/images/stages/mall/evilBG.png and b/assets/images/stages/mall/evilBG.png differ diff --git a/assets/images/stages/mall/evilSnow.png b/assets/images/stages/mall/evilSnow.png index 93f5a33a..ff420ce6 100644 Binary files a/assets/images/stages/mall/evilSnow.png and b/assets/images/stages/mall/evilSnow.png differ diff --git a/assets/images/stages/mall/evilTree.png b/assets/images/stages/mall/evilTree.png index 23623475..2a538a10 100644 Binary files a/assets/images/stages/mall/evilTree.png and b/assets/images/stages/mall/evilTree.png differ diff --git a/assets/images/stages/mall/fgSnow.png b/assets/images/stages/mall/fgSnow.png index 72a833ed..66091f02 100644 Binary files a/assets/images/stages/mall/fgSnow.png and b/assets/images/stages/mall/fgSnow.png differ diff --git a/assets/images/stages/mall/santa.png b/assets/images/stages/mall/santa.png index 9247f5aa..58c1efad 100644 Binary files a/assets/images/stages/mall/santa.png and b/assets/images/stages/mall/santa.png differ diff --git a/assets/images/stages/philly/behindTrain.png b/assets/images/stages/philly/behindTrain.png index 3f502123..fe5affe5 100644 Binary files a/assets/images/stages/philly/behindTrain.png and b/assets/images/stages/philly/behindTrain.png differ diff --git a/assets/images/stages/philly/city.png b/assets/images/stages/philly/city.png index 4d219173..46c44b20 100644 Binary files a/assets/images/stages/philly/city.png and b/assets/images/stages/philly/city.png differ diff --git a/assets/images/stages/philly/sky.png b/assets/images/stages/philly/sky.png index ac4ac9ad..cf502063 100644 Binary files a/assets/images/stages/philly/sky.png and b/assets/images/stages/philly/sky.png differ diff --git a/assets/images/stages/philly/street.png b/assets/images/stages/philly/street.png index d39b18af..14fd87bd 100644 Binary files a/assets/images/stages/philly/street.png and b/assets/images/stages/philly/street.png differ diff --git a/assets/images/stages/philly/win.png b/assets/images/stages/philly/win.png index 5a72558f..4e0091d6 100644 Binary files a/assets/images/stages/philly/win.png and b/assets/images/stages/philly/win.png differ diff --git a/assets/images/stages/school/animatedEvilSchool.png b/assets/images/stages/school/animatedEvilSchool.png index fddca234..bc98fffc 100644 Binary files a/assets/images/stages/school/animatedEvilSchool.png and b/assets/images/stages/school/animatedEvilSchool.png differ diff --git a/assets/images/stages/school/bgFreaks.png b/assets/images/stages/school/bgFreaks.png index 00487b13..db53cb20 100644 Binary files a/assets/images/stages/school/bgFreaks.png and b/assets/images/stages/school/bgFreaks.png differ diff --git a/assets/images/stages/school/petals.png b/assets/images/stages/school/petals.png index 5d9ff017..9ec86f70 100644 Binary files a/assets/images/stages/school/petals.png and b/assets/images/stages/school/petals.png differ diff --git a/assets/images/stages/school/ui/arrowEnds.png b/assets/images/stages/school/ui/arrowEnds.png index 105ab377..9d4dc874 100644 Binary files a/assets/images/stages/school/ui/arrowEnds.png and b/assets/images/stages/school/ui/arrowEnds.png differ diff --git a/assets/images/stages/school/ui/bad.png b/assets/images/stages/school/ui/bad.png index 081ae36b..364c8ac4 100644 Binary files a/assets/images/stages/school/ui/bad.png and b/assets/images/stages/school/ui/bad.png differ diff --git a/assets/images/stages/school/ui/combo.png b/assets/images/stages/school/ui/combo.png index dfff9d66..154244a1 100644 Binary files a/assets/images/stages/school/ui/combo.png and b/assets/images/stages/school/ui/combo.png differ diff --git a/assets/images/stages/school/ui/good.png b/assets/images/stages/school/ui/good.png index 7c9dd9dc..302986dc 100644 Binary files a/assets/images/stages/school/ui/good.png and b/assets/images/stages/school/ui/good.png differ diff --git a/assets/images/stages/school/ui/hand_textbox.png b/assets/images/stages/school/ui/hand_textbox.png index 64156174..5b4f1361 100644 Binary files a/assets/images/stages/school/ui/hand_textbox.png and b/assets/images/stages/school/ui/hand_textbox.png differ diff --git a/assets/images/stages/school/ui/num0.png b/assets/images/stages/school/ui/num0.png index bd51ee85..d002c36c 100644 Binary files a/assets/images/stages/school/ui/num0.png and b/assets/images/stages/school/ui/num0.png differ diff --git a/assets/images/stages/school/ui/num1.png b/assets/images/stages/school/ui/num1.png index b39d8d69..45a78d5b 100644 Binary files a/assets/images/stages/school/ui/num1.png and b/assets/images/stages/school/ui/num1.png differ diff --git a/assets/images/stages/school/ui/num2.png b/assets/images/stages/school/ui/num2.png index 873a743b..29396f94 100644 Binary files a/assets/images/stages/school/ui/num2.png and b/assets/images/stages/school/ui/num2.png differ diff --git a/assets/images/stages/school/ui/num3.png b/assets/images/stages/school/ui/num3.png index 714c8017..00dde82e 100644 Binary files a/assets/images/stages/school/ui/num3.png and b/assets/images/stages/school/ui/num3.png differ diff --git a/assets/images/stages/school/ui/num4.png b/assets/images/stages/school/ui/num4.png index d948032d..d3be8b8c 100644 Binary files a/assets/images/stages/school/ui/num4.png and b/assets/images/stages/school/ui/num4.png differ diff --git a/assets/images/stages/school/ui/num5.png b/assets/images/stages/school/ui/num5.png index d335fe5f..cde2a204 100644 Binary files a/assets/images/stages/school/ui/num5.png and b/assets/images/stages/school/ui/num5.png differ diff --git a/assets/images/stages/school/ui/num6.png b/assets/images/stages/school/ui/num6.png index 43ceb30f..cea53eb9 100644 Binary files a/assets/images/stages/school/ui/num6.png and b/assets/images/stages/school/ui/num6.png differ diff --git a/assets/images/stages/school/ui/num7.png b/assets/images/stages/school/ui/num7.png index 7b3728d1..f43639e7 100644 Binary files a/assets/images/stages/school/ui/num7.png and b/assets/images/stages/school/ui/num7.png differ diff --git a/assets/images/stages/school/ui/num8.png b/assets/images/stages/school/ui/num8.png index 58a8860e..63531c58 100644 Binary files a/assets/images/stages/school/ui/num8.png and b/assets/images/stages/school/ui/num8.png differ diff --git a/assets/images/stages/school/ui/num9.png b/assets/images/stages/school/ui/num9.png index 7c137057..91b05b66 100644 Binary files a/assets/images/stages/school/ui/num9.png and b/assets/images/stages/school/ui/num9.png differ diff --git a/assets/images/stages/school/ui/pixel-secret-splashes.png b/assets/images/stages/school/ui/pixel-secret-splashes.png index 041ee110..b686e686 100644 Binary files a/assets/images/stages/school/ui/pixel-secret-splashes.png and b/assets/images/stages/school/ui/pixel-secret-splashes.png differ diff --git a/assets/images/stages/school/ui/pixel-splashes.png b/assets/images/stages/school/ui/pixel-splashes.png index 43535dca..78a06c6a 100644 Binary files a/assets/images/stages/school/ui/pixel-splashes.png and b/assets/images/stages/school/ui/pixel-splashes.png differ diff --git a/assets/images/stages/school/ui/set.png b/assets/images/stages/school/ui/set.png index a09f8a12..b73b8449 100644 Binary files a/assets/images/stages/school/ui/set.png and b/assets/images/stages/school/ui/set.png differ diff --git a/assets/images/stages/school/ui/shit.png b/assets/images/stages/school/ui/shit.png index d520a728..46f415eb 100644 Binary files a/assets/images/stages/school/ui/shit.png and b/assets/images/stages/school/ui/shit.png differ diff --git a/assets/images/stages/school/weebSchool.png b/assets/images/stages/school/weebSchool.png index 4206d379..a54e6cc7 100644 Binary files a/assets/images/stages/school/weebSchool.png and b/assets/images/stages/school/weebSchool.png differ diff --git a/assets/images/stages/school/weebSky.png b/assets/images/stages/school/weebSky.png index dfd2203f..4d7201d4 100644 Binary files a/assets/images/stages/school/weebSky.png and b/assets/images/stages/school/weebSky.png differ diff --git a/assets/images/stages/school/weebStreet.png b/assets/images/stages/school/weebStreet.png index 82bf8caf..b8fc1247 100644 Binary files a/assets/images/stages/school/weebStreet.png and b/assets/images/stages/school/weebStreet.png differ diff --git a/assets/images/stages/school/weebTrees.png b/assets/images/stages/school/weebTrees.png index e88ffa0e..b62368f2 100644 Binary files a/assets/images/stages/school/weebTrees.png and b/assets/images/stages/school/weebTrees.png differ diff --git a/assets/images/stages/spooky/halloween_bg.png b/assets/images/stages/spooky/halloween_bg.png index b25868b0..2105bc83 100644 Binary files a/assets/images/stages/spooky/halloween_bg.png and b/assets/images/stages/spooky/halloween_bg.png differ diff --git a/assets/images/stages/tank/smokeLeft.png b/assets/images/stages/tank/smokeLeft.png index 98c80ceb..37dc5781 100644 Binary files a/assets/images/stages/tank/smokeLeft.png and b/assets/images/stages/tank/smokeLeft.png differ diff --git a/assets/images/stages/tank/tank0.png b/assets/images/stages/tank/tank0.png index d90253f2..ec79629f 100644 Binary files a/assets/images/stages/tank/tank0.png and b/assets/images/stages/tank/tank0.png differ diff --git a/assets/images/stages/tank/tank1.png b/assets/images/stages/tank/tank1.png index c20762d8..8701e98b 100644 Binary files a/assets/images/stages/tank/tank1.png and b/assets/images/stages/tank/tank1.png differ diff --git a/assets/images/stages/tank/tank2.png b/assets/images/stages/tank/tank2.png index 6a7d0008..0e43ff77 100644 Binary files a/assets/images/stages/tank/tank2.png and b/assets/images/stages/tank/tank2.png differ diff --git a/assets/images/stages/tank/tank3.png b/assets/images/stages/tank/tank3.png index 48be5e74..9425d9ee 100644 Binary files a/assets/images/stages/tank/tank3.png and b/assets/images/stages/tank/tank3.png differ diff --git a/assets/images/stages/tank/tank4.png b/assets/images/stages/tank/tank4.png index eb37b318..c3cb2685 100644 Binary files a/assets/images/stages/tank/tank4.png and b/assets/images/stages/tank/tank4.png differ diff --git a/assets/images/stages/tank/tank5.png b/assets/images/stages/tank/tank5.png index 65996f33..2a4a40ab 100644 Binary files a/assets/images/stages/tank/tank5.png and b/assets/images/stages/tank/tank5.png differ diff --git a/assets/images/stages/tank/tankBuildings.png b/assets/images/stages/tank/tankBuildings.png index 7ddebf44..7ebdcc19 100644 Binary files a/assets/images/stages/tank/tankBuildings.png and b/assets/images/stages/tank/tankBuildings.png differ diff --git a/assets/images/stages/tank/tankClouds.png b/assets/images/stages/tank/tankClouds.png index d8cc58ae..c0112da0 100644 Binary files a/assets/images/stages/tank/tankClouds.png and b/assets/images/stages/tank/tankClouds.png differ diff --git a/assets/images/stages/tank/tankGround.png b/assets/images/stages/tank/tankGround.png index 7711d102..956b9e9e 100644 Binary files a/assets/images/stages/tank/tankGround.png and b/assets/images/stages/tank/tankGround.png differ diff --git a/assets/images/stages/tank/tankRolling.png b/assets/images/stages/tank/tankRolling.png index 4e61ad22..016aa7e1 100644 Binary files a/assets/images/stages/tank/tankRolling.png and b/assets/images/stages/tank/tankRolling.png differ diff --git a/assets/images/stages/tank/tankRuins.png b/assets/images/stages/tank/tankRuins.png index cb84bd3d..1169d7f4 100644 Binary files a/assets/images/stages/tank/tankRuins.png and b/assets/images/stages/tank/tankRuins.png differ diff --git a/assets/images/stages/tank/tankSky.png b/assets/images/stages/tank/tankSky.png index bba1bb8a..9a0a6207 100644 Binary files a/assets/images/stages/tank/tankSky.png and b/assets/images/stages/tank/tankSky.png differ diff --git a/assets/images/stages/tank/tankWatchtower.png b/assets/images/stages/tank/tankWatchtower.png index d37babbb..c77d397a 100644 Binary files a/assets/images/stages/tank/tankWatchtower.png and b/assets/images/stages/tank/tankWatchtower.png differ diff --git a/assets/shaders/engine/CompatabilityGuide.md b/assets/shaders/engine/CompatabilityGuide.md new file mode 100644 index 00000000..2fe7bc87 --- /dev/null +++ b/assets/shaders/engine/CompatabilityGuide.md @@ -0,0 +1,70 @@ +## Here are guides on common mistakes and advices for writting shaders for flixel and openfl. + +It's important to follow this guide as most shader coders make these mistakes a lot and end up with shaders that only work on certain devices. + +------- +### Common mistakes and how to avoid them +Avoid using `0.` or `.0` for floats, instead, use `0.0` (ending the float number with an `.0`) +(please note that despite half floats working on nVidia gpus, other gpus like AMD gpus don't support this feature) + +Avoid using switch cases, and use if statements where possible. +(switch cases are not supported on macOS or miscellaneous platforms) + +Ints are not recommended when initiating vectors. (ex, vec2(1, 1) is not supported on certain platforms). +And use floats where it's expected. Like mod(1.0, 2.0) instead of mod(1, 2) + +Avoid using the following types: +- ivec2,3,4 +- bvec2,3,4 +- uvec2,3,4 +- uint + +as they are unsupported on certain platforms. + +Avoid using `gl_` at the start of your variables (ex, `float gl_Number` can break your shaders). + +Applying defaults to uniforms is not possible, so please set the defaults in your shader constructor or after initializing the shader. + +Avoid using `u` (ex, 8u) +Avoid initializing variables with the name `input` or `sample`, as those cause the shader to stop working on AMD gpus or other platforms. + +Avoid using the % operator, instead use the mod function. + +Avoid using arrays if possible. + +### Guide to porting shaders from shadertoy.com +This is a sample shader that simply renders the texture of a sprite/camera. +```glsl +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + // Normalized pixel coordinates (from 0 to 1) + vec2 uv = fragCoord/iResolution.xy; + + // Time varying pixel color + vec4 col = texture(iChannel0, uv); + + // Output to screen + fragColor = col; +} +``` +We will show each step to converting this shader into an usable openfl/flixel shader + +1. replace ``void mainImage( out vec4 fragColor, in vec2 fragCoord )`` with a simple ``void main()`` (flixel and openfl do not have any parameters since the coords are defined outside the function) +2. replace ``vec2 uv = fragCoord/iResolution.xy;`` with ``vec2 uv = openfl_TextureCoordv`` (or in some cases, add ``vec2 fragCoord = openfl_TextureCoordv*openfl_TextureSize.xy`` before it and replace `iResolution.xy` with ``openfl_TextureSize.xy`` (if the uv value is different than usual)) +3. replace ``vec4 col = texture(iChannel0, uv);`` with ``vec4 col = texture2D(bitmap, uv);`` or ``vec4 col = flixel_texture2D(bitmap, uv);`` (keep in mind bitmap is the pixels of the camera/sprite the shader is aplied to) +4. finally, replace ``fragColor = col;`` with ``gl_FragColor = col;`` + +###### Keep in mind that this covers the most basic on how to convert a shader from shadertoy.com, complex shaders will need more expertise with handling shaders before converting those. + +------- + +### Common Practice: + +Use ``texture2D`` for camera shaders, and FlxGame shaders, and ``flixel_texture2D`` for sprite shaders. +``flixel_texture2D`` applies the .colorTransform, while ``texture2D`` doesn't. + +------- + +Extra: + +Use tabs for indentation \ No newline at end of file diff --git a/assets/shaders/engine/cameraClip.frag b/assets/shaders/engine/cameraClip.frag index d5c2dc35..becd3d1f 100644 --- a/assets/shaders/engine/cameraClip.frag +++ b/assets/shaders/engine/cameraClip.frag @@ -13,5 +13,5 @@ void main() vec2 pixel = gl_FragCoord.xy; if (boxCollision(pixel, clipRect)) gl_FragColor = flixel_texture2D(bitmap, openfl_TextureCoordv.xy); - else gl_FragColor = vec4(0.); + else gl_FragColor = vec4(0.0); } \ No newline at end of file diff --git a/assets/shaders/engine/editorBlur.frag b/assets/shaders/engine/editorBlur.frag index ffcbc755..937aa028 100644 --- a/assets/shaders/engine/editorBlur.frag +++ b/assets/shaders/engine/editorBlur.frag @@ -7,12 +7,9 @@ int steps = 16; int stepsInside = 2; float strength = 0.0075; vec4 getColor(vec2 pos) { - if (pos.x < 0.0) pos.x = 0.0; - else if (pos.x > 1.0 - (1.0 / openfl_TextureSize.x)) pos.x = 1.0 - (1.0 / openfl_TextureSize.x); - if (pos.y < 0.0) pos.y = 0.0; - else if (pos.y > 1.0 - (1.0 / openfl_TextureSize.y)) pos.y = 1.0 - (1.0 / openfl_TextureSize.y); - // return textureCam(bitmap, pos); - return flixel_texture2D(bitmap, pos); + vec2 ps = (pos); + ps = clamp(ps, vec2(0.0), 1.0 - (1.0 / openfl_TextureSize.xy)); + return flixel_texture2D(bitmap, (ps)); } void main() { // vec2 camPos = getCamPos(openfl_TextureCoordv); diff --git a/assets/shaders/engine/editorWaveforms.frag b/assets/shaders/engine/editorWaveforms.frag index c2ea827d..b90ea5ea 100644 --- a/assets/shaders/engine/editorWaveforms.frag +++ b/assets/shaders/engine/editorWaveforms.frag @@ -14,7 +14,7 @@ uniform float pixelOffset; uniform float playerPosition; uniform sampler2D waveformTexture; -uniform ivec2 waveformSize; +uniform vec2 waveformSize; uniform bool lowDetail; @@ -22,7 +22,7 @@ float getAmplitude(vec2 pixel) { float pixelID = floor((pixel.y+pixelOffset)/3.0); // TODO: INVESTIGATE THE 1.+ AND WHY IT WORKS (SRSLY I GOT NO CLUE) -lunar - vec2 wavePixel = vec2(mod(pixelID,waveformSize.x), 1.0+floor(pixelID/waveformSize.x)); + vec2 wavePixel = vec2(mod(pixelID, waveformSize.x), 1.0+floor(pixelID/waveformSize.x)); vec4 waveData = texture2D(waveformTexture, wavePixel / waveformSize); int id = int(mod(wavePixel.x, 3.0)); diff --git a/assets/songs/stress/scripts/tankmenRun.hx b/assets/songs/stress/scripts/tankmenRun.hx index 2b519b11..a7d7a306 100644 --- a/assets/songs/stress/scripts/tankmenRun.hx +++ b/assets/songs/stress/scripts/tankmenRun.hx @@ -8,10 +8,7 @@ var tankmanPool = []; function recycleTankman() { if(tankmanPool.length == 0) { - var a = new TankmenBG(); - a.self = a; - a.fuckingnewfuckingnew(); - return a; + return new TankmenBG(); } else { return tankmanPool.shift(); // can be pop but it causes it to be less random } @@ -73,8 +70,7 @@ function update(elapsed) { } } -class TankmenBG -{ +class TankmenBG { var strumTime = 0; var goingRight = false; var tankSpeed = 0.7; @@ -82,11 +78,9 @@ class TankmenBG var endingOffset = null; var sprite = null; - var self = null; var killed = false; - var fuckingnewfuckingnew = function() - { + function new() { this.sprite = new FlxSprite(); var sprite = this.sprite; @@ -102,8 +96,7 @@ class TankmenBG sprite.updateHitbox(); } - var resetShit = function(x, y, isGoingRight) - { + function resetShit(x, y, isGoingRight) { var sprite = this.sprite; sprite.revive(); sprite.setPosition(x, y); @@ -120,8 +113,7 @@ class TankmenBG sprite.flipX = goingRight; } - var update = function(elapsed) - { + function update(elapsed) { var sprite = this.sprite; sprite.visible = !(sprite.x >= FlxG.width * 1.5 || sprite.x <= FlxG.width * -0.5); @@ -143,8 +135,8 @@ class TankmenBG killed = true; grpTankmanRun.remove(sprite, true); sprite.kill(); - tankmanPool.push(self); - tankmanRun.remove(self); + tankmanPool.push(this); + tankmanRun.remove(this); } if (goingRight) diff --git a/commandline/commands/Setup.hx b/commandline/commands/Setup.hx index 23e289cb..2fd3554e 100644 --- a/commandline/commands/Setup.hx +++ b/commandline/commands/Setup.hx @@ -23,6 +23,7 @@ class Setup { var CHECK_VSTUDIO = !args.existsOption("no-vscheck"); var REINSTALL_ALL = args.existsOption("reinstall"); var SILENT = args.existsOption("silent-progress"); + // TODO: add only install missing libs // to prevent messing with currently installed libs if (!FileSystem.exists('.haxelib')) diff --git a/libs.xml b/libs.xml index 72839c56..6e4b44c4 100644 --- a/libs.xml +++ b/libs.xml @@ -5,14 +5,15 @@ - + + - + @@ -41,11 +42,12 @@ - + + - + --> + diff --git a/setup-dev-branch.xml b/setup-dev-branch.xml index 992a440f..0835f21c 100644 --- a/setup-dev-branch.xml +++ b/setup-dev-branch.xml @@ -2,7 +2,7 @@ Switching to branch 'time-fix'... - + @@ -12,7 +12,7 @@ Switching to branch 'dev'... - + @@ -20,7 +20,7 @@ Done! Make sure to switch the branch on Codename Engine to 'main' before compiling! - Rebuilding Lime... - - + + + diff --git a/setup-dev.xml b/setup-dev.xml index 3f8b70ac..e68ef224 100644 --- a/setup-dev.xml +++ b/setup-dev.xml @@ -27,7 +27,7 @@ - + + - + --> @@ -94,5 +94,20 @@ + + + + haxelib dev lime ../../lime + haxelib dev openfl ../../openfl + haxelib dev flixel ../../flixel + haxelib dev flixel-addons ../../flixel-addons + haxelib dev hscript-improved ../../hscript-improved + haxelib dev flxanimate ../../flxanimate + + haxelib dev away3d ../../away3d + haxelib dev hxcpp ../../../hxcpp + + + Setup for dev libs complete! diff --git a/source/StringTools.hx b/source/StringTools.hx new file mode 100644 index 00000000..0b495af1 --- /dev/null +++ b/source/StringTools.hx @@ -0,0 +1,632 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import haxe.iterators.StringIterator; +import haxe.iterators.StringKeyValueIterator; + +#if cpp +using cpp.NativeString; +#end + +/** + This class provides advanced methods on Strings. It is ideally used with + `using StringTools` and then acts as an [extension](https://haxe.org/manual/lf-static-extension.html) + to the `String` class. + + If the first argument to any of the methods is null, the result is + unspecified. +**/ +class StringTools { + /** + Encode an URL by using the standard format. + **/ + #if (!java && !cpp && !lua && !eval) inline #end public static function urlEncode(s:String):String { + #if flash + return untyped __global__["encodeURIComponent"](s); + #elseif neko + return untyped new String(_urlEncode(s.__s)); + #elseif js + return untyped encodeURIComponent(s); + #elseif cpp + return untyped s.__URLEncode(); + #elseif java + return postProcessUrlEncode(java.net.URLEncoder.encode(s, "UTF-8")); + #elseif python + return python.lib.urllib.Parse.quote(s, ""); + #elseif hl + var len = 0; + var b = @:privateAccess s.bytes.urlEncode(len); + return @:privateAccess String.__alloc__(b, len); + #elseif lua + s = lua.NativeStringTools.gsub(s, "\n", "\r\n"); + s = lua.NativeStringTools.gsub(s, "([^%w %-%_%.%~])", function(c) { + return lua.NativeStringTools.format("%%%02X", lua.NativeStringTools.byte(c) + ''); + }); + s = lua.NativeStringTools.gsub(s, " ", "+"); + return s; + #else + return null; + #end + } + + #if java + private static function postProcessUrlEncode(s:String):String { + var ret = new StringBuf(); + var i = 0, len = s.length; + while (i < len) { + switch (_charAt(s, i++)) { + case '+'.code: + ret.add('%20'); + case '%'.code if (i <= len - 2): + var c1 = _charAt(s, i++), c2 = _charAt(s, i++); + switch [c1, c2] { + case ['2'.code, '1'.code]: + ret.addChar('!'.code); + case ['2'.code, '7'.code]: + ret.addChar('\''.code); + case ['2'.code, '8'.code]: + ret.addChar('('.code); + case ['2'.code, '9'.code]: + ret.addChar(')'.code); + case ['7'.code, 'E'.code] | ['7'.code, 'e'.code]: + ret.addChar('~'.code); + case _: + ret.addChar('%'.code); + ret.addChar(cast c1); + ret.addChar(cast c2); + } + case var chr: + ret.addChar(cast chr); + } + } + return ret.toString(); + } + #end + + /** + Decode an URL using the standard format. + **/ + #if (!java && !cpp && !lua && !eval) inline #end public static function urlDecode(s:String):String { + #if flash + return untyped __global__["decodeURIComponent"](s.split("+").join(" ")); + #elseif neko + return untyped new String(_urlDecode(s.__s)); + #elseif js + return untyped decodeURIComponent(s.split("+").join(" ")); + #elseif cpp + return untyped s.__URLDecode(); + #elseif java + try + return java.net.URLDecoder.decode(s, "UTF-8") + catch (e:Dynamic) + throw e; + #elseif python + return python.lib.urllib.Parse.unquote(s); + #elseif hl + var len = 0; + var b = @:privateAccess s.bytes.urlDecode(len); + return @:privateAccess String.__alloc__(b, len); + #elseif lua + s = lua.NativeStringTools.gsub(s, "+", " "); + s = lua.NativeStringTools.gsub(s, "%%(%x%x)", function(h) { + return lua.NativeStringTools.char(lua.Lua.tonumber(h, 16)); + }); + s = lua.NativeStringTools.gsub(s, "\r\n", "\n"); + return s; + #else + return null; + #end + } + + /** + Escapes HTML special characters of the string `s`. + + The following replacements are made: + + - `&` becomes `&`; + - `<` becomes `<`; + - `>` becomes `>`; + + If `quotes` is true, the following characters are also replaced: + + - `"` becomes `"`; + - `'` becomes `'`; + **/ + public static function htmlEscape(s:String, ?quotes:Bool):String { + var buf = new StringBuf(); + for (code in #if neko iterator(s) #else new haxe.iterators.StringIteratorUnicode(s) #end) { + switch (code) { + case '&'.code: + buf.add("&"); + case '<'.code: + buf.add("<"); + case '>'.code: + buf.add(">"); + case '"'.code if (quotes): + buf.add("""); + case '\''.code if (quotes): + buf.add("'"); + case _: + buf.addChar(code); + } + } + return buf.toString(); + } + + /** + Unescapes HTML special characters of the string `s`. + + This is the inverse operation to htmlEscape, i.e. the following always + holds: `htmlUnescape(htmlEscape(s)) == s` + + The replacements follow: + + - `&` becomes `&` + - `<` becomes `<` + - `>` becomes `>` + - `"` becomes `"` + - `'` becomes `'` + **/ + public static function htmlUnescape(s:String):String { + return s.split(">") + .join(">") + .split("<") + .join("<") + .split(""") + .join('"') + .split("'") + .join("'") + .split("&") + .join("&"); + } + + /** + Returns `true` if `s` contains `value` and `false` otherwise. + + When `value` is `null`, the result is unspecified. + **/ + public static inline function contains(s:String, value:String):Bool { + #if (js && js_es >= 6) + return (cast s).includes(value); + #else + return s.indexOf(value) != -1; + #end + } + + /** + Tells if the string `s` starts with the string `start`. + + If `start` is `null`, the result is unspecified. + + If `start` is the empty String `""`, the result is true. + **/ + public static #if (java || python || (js && js_es >= 6)) inline #end function startsWith(s:String, start:String):Bool { + #if java + return (cast s : java.NativeString).startsWith(start); + #elseif hl + return @:privateAccess (s.length >= start.length && s.bytes.compare(0, start.bytes, 0, start.length << 1) == 0); + #elseif python + return python.NativeStringTools.startswith(s, start); + #elseif (js && js_es >= 6) + return (cast s).startsWith(start); + #elseif lua + return untyped __lua__("{0}:sub(1, #{1}) == {1}", s, start); + #else + return (s.length >= start.length && s.indexOf(start, 0) == 0); + #end + } + + /** + Tells if the string `s` ends with the string `end`. + + If `end` is `null`, the result is unspecified. + + If `end` is the empty String `""`, the result is true. + **/ + public static #if (java || python || (js && js_es >= 6)) inline #end function endsWith(s:String, end:String):Bool { + #if java + return (cast s : java.NativeString).endsWith(end); + #elseif hl + var elen = end.length; + var slen = s.length; + return @:privateAccess (slen >= elen && s.bytes.compare((slen - elen) << 1, end.bytes, 0, elen << 1) == 0); + #elseif python + return python.NativeStringTools.endswith(s, end); + #elseif (js && js_es >= 6) + return (cast s).endsWith(end); + #elseif lua + return end == "" || untyped __lua__("{0}:sub(-#{1}) == {1}", s, end); + #else + var elen = end.length; + var slen = s.length; + return (slen >= elen && s.lastIndexOf(end, (slen - elen)) == (slen - elen)); + #end + } + + /** + Tells if the character in the string `s` at position `pos` is a space. + + A character is considered to be a space character if its character code + is 9,10,11,12,13 or 32. + + If `s` is the empty String `""`, or if pos is not a valid position within + `s`, the result is false. + **/ + public static function isSpace(s:String, pos:Int):Bool { + #if (python || lua) + if (s.length == 0 || pos < 0 || pos >= s.length) + return false; + #end + var c = StringTools.fastCodeAt(s, pos); + return (c > 8 && c < 14) || c == 32; + } + + /** + Removes leading space characters of `s`. + + This function internally calls `isSpace()` to decide which characters to + remove. + + If `s` is the empty String `""` or consists only of space characters, the + result is the empty String `""`. + **/ + public inline static function ltrim(s:String):String { + var l = s.length; + var r = 0; + while (r < l && isSpace(s, r)) { + r++; + } + if (r > 0) + return s.substr(r, l - r); + else + return s; + } + + /** + Removes trailing space characters of `s`. + + This function internally calls `isSpace()` to decide which characters to + remove. + + If `s` is the empty String `""` or consists only of space characters, the + result is the empty String `""`. + **/ + public inline static function rtrim(s:String):String { + var l = s.length; + var r = 0; + while (r < l && isSpace(s, l - r - 1)) { + r++; + } + if (r > 0) { + return s.substr(0, l - r); + } else { + return s; + } + } + + /** + Removes leading and trailing space characters of `s`. + + This is a convenience function for `ltrim(rtrim(s))`. + **/ + public #if java inline #end static function trim(s:String):String { + #if java + return (cast s : java.NativeString).trim(); + #else + //return ltrim(rtrim(s)); + var l = s.length; + var start = 0; + var end = l; + + // Trim leading spaces + while (start < l && isSpace(s, start)) { + start++; + } + + // Trim trailing spaces + while (end > start && isSpace(s, end - 1)) { + end--; + } + + return (start > 0 || end < l) ? s.substr(start, end - start) : s; + #end + } + + /** + Concatenates `c` to `s` until `s.length` is at least `l`. + + If `c` is the empty String `""` or if `l` does not exceed `s.length`, + `s` is returned unchanged. + + If `c.length` is 1, the resulting String length is exactly `l`. + + Otherwise the length may exceed `l`. + + If `c` is null, the result is unspecified. + **/ + public static function lpad(s:String, c:String, l:Int):String { + if (c.length <= 0) + return s; + + var buf = new StringBuf(); + l -= s.length; + while (buf.length < l) { + buf.add(c); + } + buf.add(s); + return buf.toString(); + } + + /** + Appends `c` to `s` until `s.length` is at least `l`. + + If `c` is the empty String `""` or if `l` does not exceed `s.length`, + `s` is returned unchanged. + + If `c.length` is 1, the resulting String length is exactly `l`. + + Otherwise the length may exceed `l`. + + If `c` is null, the result is unspecified. + **/ + public static function rpad(s:String, c:String, l:Int):String { + if (c.length <= 0) + return s; + + var buf = new StringBuf(); + buf.add(s); + while (buf.length < l) { + buf.add(c); + } + return buf.toString(); + } + + /** + Replace all occurrences of the String `sub` in the String `s` by the + String `by`. + + If `sub` is the empty String `""`, `by` is inserted after each character + of `s` except the last one. If `by` is also the empty String `""`, `s` + remains unchanged. + + If `sub` or `by` are null, the result is unspecified. + **/ + public static function replace(s:String, sub:String, by:String):String { + #if java + if (sub.length == 0) + return s.split(sub).join(by); + else + return (cast s : java.NativeString).replace(sub, by); + #else + return s.split(sub).join(by); + #end + } + + /** + Encodes `n` into a hexadecimal representation. + + If `digits` is specified, the resulting String is padded with "0" until + its `length` equals `digits`. + **/ + public static function hex(n:Int, ?digits:Int) { + #if flash + var n:UInt = n; + var s:String = untyped n.toString(16); + s = s.toUpperCase(); + #else + var s = ""; + var hexChars = "0123456789ABCDEF"; + do { + s = hexChars.charAt(n & 15) + s; + n >>>= 4; + } while (n > 0); + #end + #if python + if (digits != null && s.length < digits) { + var diff = digits - s.length; + for (_ in 0...diff) { + s = "0" + s; + } + } + #else + if (digits != null) + while (s.length < digits) + s = "0" + s; + #end + return s; + } + + /** + Returns the character code at position `index` of String `s`, or an + end-of-file indicator at if `position` equals `s.length`. + + This method is faster than `String.charCodeAt()` on some platforms, but + the result is unspecified if `index` is negative or greater than + `s.length`. + + End of file status can be checked by calling `StringTools.isEof()` with + the returned value as argument. + + This operation is not guaranteed to work if `s` contains the `\0` + character. + **/ + public static #if !eval inline #end function fastCodeAt(s:String, index:Int):Int { + #if neko + return untyped __dollar__sget(s.__s, index); + #elseif cpp + return untyped s.cca(index); + #elseif flash + return untyped s.cca(index); + #elseif java + return (index < s.length) ? cast(_charAt(s, index), Int) : -1; + #elseif js + return (cast s).charCodeAt(index); + #elseif python + return if (index >= s.length) -1 else python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index)); + #elseif hl + return @:privateAccess s.bytes.getUI16(index << 1); + #elseif lua + #if lua_vanilla + return lua.NativeStringTools.byte(s, index + 1); + #else + return lua.lib.luautf8.Utf8.byte(s, index + 1); + #end + #else + return untyped s.cca(index); + #end + } + + /** + Returns the character code at position `index` of String `s`, or an + end-of-file indicator at if `position` equals `s.length`. + + This method is faster than `String.charCodeAt()` on some platforms, but + the result is unspecified if `index` is negative or greater than + `s.length`. + + This operation is not guaranteed to work if `s` contains the `\0` + character. + **/ + public static #if !eval inline #end function unsafeCodeAt(s:String, index:Int):Int { + #if neko + return untyped __dollar__sget(s.__s, index); + #elseif cpp + return untyped s.cca(index); + #elseif flash + return untyped s.cca(index); + #elseif java + return cast(_charAt(s, index), Int); + #elseif js + return (cast s).charCodeAt(index); + #elseif python + return python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index)); + #elseif hl + return @:privateAccess s.bytes.getUI16(index << 1); + #elseif lua + #if lua_vanilla + return lua.NativeStringTools.byte(s, index + 1); + #else + return lua.lib.luautf8.Utf8.byte(s, index + 1); + #end + #else + return untyped s.cca(index); + #end + } + + /** + Returns an iterator of the char codes. + + Note that char codes may differ across platforms because of different + internal encoding of strings in different runtimes. + For the consistent cross-platform UTF8 char codes see `haxe.iterators.StringIteratorUnicode`. + **/ + public static inline function iterator(s:String):StringIterator { + return new StringIterator(s); + } + + /** + Returns an iterator of the char indexes and codes. + + Note that char codes may differ across platforms because of different + internal encoding of strings in different of runtimes. + For the consistent cross-platform UTF8 char codes see `haxe.iterators.StringKeyValueIteratorUnicode`. + **/ + public static inline function keyValueIterator(s:String):StringKeyValueIterator { + return new StringKeyValueIterator(s); + } + + /** + Tells if `c` represents the end-of-file (EOF) character. + **/ + @:noUsing public static inline function isEof(c:Int):Bool { + #if (flash || cpp || hl) + return c == 0; + #elseif js + return c != c; // fast NaN + #elseif (neko || lua || eval) + return c == null; + #elseif (java || python) + return c == -1; + #else + return false; + #end + } + + /** + Returns a String that can be used as a single command line argument + on Unix. + The input will be quoted, or escaped if necessary. + **/ + @:noCompletion + @:deprecated('StringTools.quoteUnixArg() is deprecated. Use haxe.SysTools.quoteUnixArg() instead.') + public static function quoteUnixArg(argument:String):String { + return inline haxe.SysTools.quoteUnixArg(argument); + } + + /** + Character codes of the characters that will be escaped by `quoteWinArg(_, true)`. + **/ + @:noCompletion + @:deprecated('StringTools.winMetaCharacters is deprecated. Use haxe.SysTools.winMetaCharacters instead.') + public static var winMetaCharacters:Array = cast haxe.SysTools.winMetaCharacters; + + /** + Returns a String that can be used as a single command line argument + on Windows. + The input will be quoted, or escaped if necessary, such that the output + will be parsed as a single argument using the rule specified in + http://msdn.microsoft.com/en-us/library/ms880421 + + Examples: + ```haxe + quoteWinArg("abc") == "abc"; + quoteWinArg("ab c") == '"ab c"'; + ``` + **/ + @:noCompletion + @:deprecated('StringTools.quoteWinArg() is deprecated. Use haxe.SysTools.quoteWinArg() instead.') + public static function quoteWinArg(argument:String, escapeMetaCharacters:Bool):String { + return inline haxe.SysTools.quoteWinArg(argument, escapeMetaCharacters); + } + + #if java + private static inline function _charAt(str:String, idx:Int):java.StdTypes.Char16 + return (cast str : java.NativeString).charAt(idx); + #end + + #if neko + private static var _urlEncode = neko.Lib.load("std", "url_encode", 1); + private static var _urlDecode = neko.Lib.load("std", "url_decode", 1); + #end + + #if utf16 + static inline var MIN_SURROGATE_CODE_POINT = 65536; + + static inline function utf16CodePointAt(s:String, index:Int):Int { + var c = StringTools.fastCodeAt(s, index); + if (c >= 0xD800 && c <= 0xDBFF) { + c = ((c - 0xD7C0) << 10) | (StringTools.fastCodeAt(s, index + 1) & 0x3FF); + } + return c; + } + #end +} diff --git a/source/flx3d/Flx3DUtil.hx b/source/flx3d/Flx3DUtil.hx index 029a06f3..e6c85bb0 100644 --- a/source/flx3d/Flx3DUtil.hx +++ b/source/flx3d/Flx3DUtil.hx @@ -14,7 +14,7 @@ import flixel.FlxG; * @see https://twitter.com/Ne_Eo_Twitch */ @:access(away3d.core.managers.Stage3DManager) -class Flx3DUtil +final class Flx3DUtil { #if THREE_D_SUPPORT /** diff --git a/source/funkin/backend/FunkinSprite.hx b/source/funkin/backend/FunkinSprite.hx index 40b36a02..97500198 100644 --- a/source/funkin/backend/FunkinSprite.hx +++ b/source/funkin/backend/FunkinSprite.hx @@ -181,10 +181,12 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I animateAtlas.flipX = flipX; animateAtlas.flipY = flipY; animateAtlas.shader = shader; + animateAtlas.shaderEnabled = shaderEnabled; animateAtlas.antialiasing = antialiasing; animateAtlas.skew = skew; animateAtlas.transformMatrix = transformMatrix; animateAtlas.matrixExposed = matrixExposed; + animateAtlas.colorTransform = colorTransform; } } diff --git a/source/funkin/backend/chart/Chart.hx b/source/funkin/backend/chart/Chart.hx index 0cda2064..1450d021 100644 --- a/source/funkin/backend/chart/Chart.hx +++ b/source/funkin/backend/chart/Chart.hx @@ -11,7 +11,7 @@ import sys.FileSystem; using StringTools; -class Chart { +final class Chart { /** * Default background colors for songs without bg color */ diff --git a/source/funkin/backend/chart/EventsData.hx b/source/funkin/backend/chart/EventsData.hx index 630f2269..347ba33a 100644 --- a/source/funkin/backend/chart/EventsData.hx +++ b/source/funkin/backend/chart/EventsData.hx @@ -9,7 +9,7 @@ import openfl.Assets; using StringTools; -class EventsData { +final class EventsData { public static var defaultEventsList:Array = ["HScript Call", "Camera Movement", "Add Camera Zoom", "Camera Modulo Change", "Camera Flash", "BPM Change", "Scroll Speed Change", "Alt Animation Toggle", "Play Animation"]; public static var defaultEventsParams:Map> = [ "HScript Call" => [ @@ -70,6 +70,8 @@ class EventsData { hscriptInterp.variables.set("StrumLine", TStrumLine); hscriptInterp.variables.set("ColorWheel", TColorWheel); hscriptInterp.variables.set("DropDown", Reflect.makeVarArgs((args) -> {return args.length > 0 ? TDropDown([for (arg in args) Std.string(arg)]) : TDropDown(["null"]);})); + hscriptInterp.variables.set("Character", TCharacter); + hscriptInterp.variables.set("Stage", TStage); var hscriptParser:Parser = new Parser(); hscriptParser.allowJSON = hscriptParser.allowMetadata = false; @@ -127,4 +129,6 @@ enum EventParamType { TStrumLine; TColorWheel; TDropDown(?options:Array); + TCharacter; + TStage; } diff --git a/source/funkin/backend/scripting/EventManager.hx b/source/funkin/backend/scripting/EventManager.hx index 84e7d33f..f2eeb23f 100644 --- a/source/funkin/backend/scripting/EventManager.hx +++ b/source/funkin/backend/scripting/EventManager.hx @@ -3,7 +3,7 @@ package funkin.backend.scripting; import flixel.FlxState; import funkin.backend.scripting.events.*; -class EventManager { +final class EventManager { // map doesnt work for that public static var eventValues:Array = []; public static var eventKeys:Array> = []; diff --git a/source/funkin/backend/scripting/GlobalScript.hx b/source/funkin/backend/scripting/GlobalScript.hx index c9b49ad8..d3b8aded 100644 --- a/source/funkin/backend/scripting/GlobalScript.hx +++ b/source/funkin/backend/scripting/GlobalScript.hx @@ -11,7 +11,11 @@ import funkin.backend.system.Conductor; class GlobalScript { public static var scripts:ScriptPack; + private static var initalized:Bool = false; + public static function init() { + if(initalized) return; + initalized = true; #if MOD_SUPPORT ModsFolder.onModSwitch.add(onModSwitch); #end diff --git a/source/funkin/backend/scripting/events/HealthIconChangeEvent.hx b/source/funkin/backend/scripting/events/HealthIconChangeEvent.hx new file mode 100644 index 00000000..a98493ef --- /dev/null +++ b/source/funkin/backend/scripting/events/HealthIconChangeEvent.hx @@ -0,0 +1,13 @@ +package funkin.backend.scripting.events; + +final class HealthIconChangeEvent extends CancellableEvent { + /** + * Amount + */ + public var amount:Int; + + /** + * The health icon + */ + public var healthIcon:funkin.game.HealthIcon; +} \ No newline at end of file diff --git a/source/funkin/backend/shaders/FunkinShader.hx b/source/funkin/backend/shaders/FunkinShader.hx index 612411e9..b676ae45 100644 --- a/source/funkin/backend/shaders/FunkinShader.hx +++ b/source/funkin/backend/shaders/FunkinShader.hx @@ -457,14 +457,7 @@ vec4 flixel_texture2D(sampler2D bitmap, vec2 coord) } color = vec4(color.rgb / color.a, color.a); - - mat4 colorMultiplier = mat4(0); - colorMultiplier[0][0] = openfl_ColorMultiplierv.x; - colorMultiplier[1][1] = openfl_ColorMultiplierv.y; - colorMultiplier[2][2] = openfl_ColorMultiplierv.z; - colorMultiplier[3][3] = openfl_ColorMultiplierv.w; - - color = clamp(openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0); + color = clamp(openfl_ColorOffsetv + (color * openfl_ColorMultiplierv), 0.0, 1.0); if (color.a > 0.0) { @@ -491,39 +484,9 @@ vec4 textureCam(sampler2D bitmap, vec2 pos) { return flixel_texture2D(bitmap, camToOg(pos)); }"; - public static final fragBody:String = "vec4 color = texture2D (bitmap, openfl_TextureCoordv); - -if (color.a == 0.0) { - - gl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0); - -} else if (openfl_HasColorTransform) { - - color = vec4 (color.rgb / color.a, color.a); - - mat4 colorMultiplier = mat4 (0); - colorMultiplier[0][0] = openfl_ColorMultiplierv.x; - colorMultiplier[1][1] = openfl_ColorMultiplierv.y; - colorMultiplier[2][2] = openfl_ColorMultiplierv.z; - colorMultiplier[3][3] = 1.0; // openfl_ColorMultiplierv.w; - - color = clamp (openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0); - - if (color.a > 0.0) { - - gl_FragColor = vec4 (color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav); - - } else { - - gl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0); - - } - -} else { - - gl_FragColor = color * openfl_Alphav; - -}"; + public static final fragBody:String = "vec4 color = flixel_texture2D (bitmap, openfl_TextureCoordv); + gl_FragColor = color; +"; public static final vertHeader:String = "attribute float openfl_Alpha; attribute vec4 openfl_ColorMultiplier; attribute vec4 openfl_ColorOffset; diff --git a/source/funkin/backend/shaders/WiggleEffect.hx b/source/funkin/backend/shaders/WiggleEffect.hx index 43dc1caa..21c52690 100644 --- a/source/funkin/backend/shaders/WiggleEffect.hx +++ b/source/funkin/backend/shaders/WiggleEffect.hx @@ -75,18 +75,18 @@ const int EFFECT_TYPE_FLAG = 4; uniform int effectType; /** - * How fast the waves move over time - */ +* How fast the waves move over time +*/ uniform float uSpeed; /** - * Number of waves over time - */ +* Number of waves over time +*/ uniform float uFrequency; /** - * How much the pixels are going to stretch over the waves - */ +* How much the pixels are going to stretch over the waves +*/ uniform float uWaveAmplitude; vec2 sineWave(vec2 pt) diff --git a/source/funkin/backend/system/CommandLineHandler.hx b/source/funkin/backend/system/CommandLineHandler.hx index 3690b6a2..6256c2a2 100644 --- a/source/funkin/backend/system/CommandLineHandler.hx +++ b/source/funkin/backend/system/CommandLineHandler.hx @@ -2,7 +2,7 @@ package funkin.backend.system; #if sys import sys.FileSystem; -class CommandLineHandler { +final class CommandLineHandler { public static function parseCommandLine(cmd:Array) { var i:Int = 0; while(i < cmd.length) { diff --git a/source/funkin/backend/system/Logs.hx b/source/funkin/backend/system/Logs.hx index 1f083324..ce590882 100644 --- a/source/funkin/backend/system/Logs.hx +++ b/source/funkin/backend/system/Logs.hx @@ -6,7 +6,7 @@ import funkin.backend.utils.NativeAPI.ConsoleColor; import funkin.backend.utils.NativeAPI; import haxe.Log; -class Logs { +final class Logs { private static var __showing:Bool = false; public static var nativeTrace = Log.trace; diff --git a/source/funkin/backend/system/macros/BuildInfo.hx b/source/funkin/backend/system/macros/BuildInfo.hx index 37925fa5..535f6118 100644 --- a/source/funkin/backend/system/macros/BuildInfo.hx +++ b/source/funkin/backend/system/macros/BuildInfo.hx @@ -5,6 +5,7 @@ using StringTools; #if macro class BuildInfo { public static function printBuildInfo() { + if(haxe.macro.Context.defined("display")) return; var haxeVersion = haxe.macro.Context.definedValue("haxe"); Sys.println('--- BUILD INFO ---'); Sys.println('Haxe Version: ${haxeVersion}'); diff --git a/source/funkin/backend/system/modules/AudioSwitchFix.hx b/source/funkin/backend/system/modules/AudioSwitchFix.hx index 232c1eb8..c7065f0c 100644 --- a/source/funkin/backend/system/modules/AudioSwitchFix.hx +++ b/source/funkin/backend/system/modules/AudioSwitchFix.hx @@ -11,7 +11,7 @@ import lime.media.AudioManager; * hi gray itsa me yoshicrafter29 i fixed it hehe */ @:dox(hide) -class AudioSwitchFix { +final class AudioSwitchFix { @:noCompletion private static function onStateSwitch(state:FlxState):Void { #if windows diff --git a/source/funkin/backend/system/modules/CrashHandler.hx b/source/funkin/backend/system/modules/CrashHandler.hx index 124b915c..6a460ac1 100644 --- a/source/funkin/backend/system/modules/CrashHandler.hx +++ b/source/funkin/backend/system/modules/CrashHandler.hx @@ -7,7 +7,7 @@ import openfl.errors.Error; import openfl.events.ErrorEvent; import openfl.events.UncaughtErrorEvent; -class CrashHandler { +final class CrashHandler { public static function init() { Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError); #if cpp diff --git a/source/funkin/backend/utils/BitmapUtil.hx b/source/funkin/backend/utils/BitmapUtil.hx index 866f6b25..fb9eefb2 100644 --- a/source/funkin/backend/utils/BitmapUtil.hx +++ b/source/funkin/backend/utils/BitmapUtil.hx @@ -5,7 +5,7 @@ import openfl.display.BitmapData; import openfl.geom.Point; import openfl.geom.Rectangle; -class BitmapUtil { +final class BitmapUtil { /** * Returns the most present color in a Bitmap. * @param bmap Bitmap diff --git a/source/funkin/backend/utils/CoolUtil.hx b/source/funkin/backend/utils/CoolUtil.hx index 8a518ada..ca71693b 100644 --- a/source/funkin/backend/utils/CoolUtil.hx +++ b/source/funkin/backend/utils/CoolUtil.hx @@ -42,7 +42,7 @@ import flixel.math.FlxPoint; using StringTools; @:allow(funkin.game.PlayState) -class CoolUtil +final class CoolUtil { public static function getLastExceptionStack():String { return CallStack.toString(CallStack.exceptionStack()); diff --git a/source/funkin/backend/utils/DiscordUtil.hx b/source/funkin/backend/utils/DiscordUtil.hx index db3c20c4..0aed4952 100644 --- a/source/funkin/backend/utils/DiscordUtil.hx +++ b/source/funkin/backend/utils/DiscordUtil.hx @@ -1,5 +1,6 @@ package funkin.backend.utils; +import flixel.util.FlxSignal.FlxTypedSignal; import flixel.sound.FlxSound; import flixel.util.typeLimit.OneOfTwo; import funkin.backend.scripting.*; // lazy @@ -16,7 +17,7 @@ import lime.app.Application; import sys.thread.Thread; #end -class DiscordUtil +final class DiscordUtil { public static var currentID(default, set):String = null; public static var discordThread:#if DISCORD_RPC Thread #else Dynamic #end = null; @@ -107,14 +108,28 @@ class DiscordUtil public static function loadScript() { + #if DISCORD_RPC if (script != null) { call("destroy"); script = FlxDestroyUtil.destroy(script); } script = Script.create(Paths.script('data/discord')); + script.set("ActivityType", { + Playing: ActivityType.Playing, + PLAYING: ActivityType.Playing, + Streaming: ActivityType.Streaming, + STREAMING: ActivityType.Streaming, + Watching: ActivityType.Watching, + WATCHING: ActivityType.Watching, + Listening: ActivityType.Listening, + LISTENING: ActivityType.Listening, + Competing: ActivityType.Competing, + COMPETING: ActivityType.Competing + }); // script.setParent(DiscordUtil); script.load(); + #end } public static function changePresence(details:String, state:String, ?smallImageKey:String) @@ -218,6 +233,8 @@ class DiscordUtil Utils.safeSetWrapper(dp.joinSecret, data.joinSecret, fixString); Utils.safeSetWrapper(dp.spectateSecret, data.spectateSecret, fixString); Utils.safeSet(dp.instance, data.instance); + Utils.safeSet(dp.activityType, data.activityType); + Utils.safeSetWrapper(dp.streamUrl, data.streamUrl, fixString); if (data.matchSecret == null && data.joinSecret == null && data.spectateSecret == null) { Utils.safeSetWrapper(dp.button1Label, data.button1Label, fixString); @@ -252,6 +269,7 @@ class DiscordUtil handlers.joinGame = cpp.Function.fromStaticFunction(onJoin); handlers.joinRequest = cpp.Function.fromStaticFunction(onJoinReq); handlers.spectateGame = cpp.Function.fromStaticFunction(onSpectate); + handlers.anyResponse = cpp.Function.fromStaticFunction(onAnyResponse); Discord.Initialize(id, cpp.RawPointer.addressOf(handlers), 1, null); stopThread = false; @@ -351,7 +369,38 @@ class DiscordUtil var req:DUser = DUser.initRaw(request); call("onJoinRequest", [req]); } + + public static var anyResponse:FlxTypedSignalVoid> = new FlxTypedSignalVoid>(); + + private static function onAnyResponse(data:cpp.ConstCharStar):Void + { + call("onAnyResponse", [data]); + anyResponse.dispatch(data); + } #end + + private static function getUUID():String { + var uuid = new StringBuf(); + for (i in 0...16) { + uuid.add(StringTools.hex(Math.floor(Math.random() * 16), 1)); + } + return uuid.toString(); + } + + public static function sendCustomCommand(data:Dynamic) { + #if DISCORD_RPC + if(data == null) return; + if(data.nonce == null) data.nonce = getUUID(); + var json = Json.stringify(data); + Discord.SendCustomCommand(json); + #end + } + + public static function setDebugMode(mode:Bool) { + #if DISCORD_RPC + Discord.SetDebugMode(mode); + #end + } } typedef DiscordJson = @@ -476,6 +525,8 @@ typedef DPresence = var ?button1Url:String; /* max 512 bytes */ var ?button2Label:String; /* max 32 bytes */ var ?button2Url:String; /* max 512 bytes */ + var ?activityType:ActivityType; + var ?streamUrl:String; /* max 512 bytes */ } typedef DEvents = diff --git a/source/funkin/backend/utils/DrawUtil.hx b/source/funkin/backend/utils/DrawUtil.hx index 1d0bc481..8b3976e7 100644 --- a/source/funkin/backend/utils/DrawUtil.hx +++ b/source/funkin/backend/utils/DrawUtil.hx @@ -4,7 +4,7 @@ import flixel.util.FlxColor; import flixel.math.FlxAngle; import flixel.math.FlxPoint; -class DrawUtil { +final class DrawUtil { public static var line:FlxSprite = null; public static var dot:FlxSprite = null; diff --git a/source/funkin/backend/utils/EngineUtil.hx b/source/funkin/backend/utils/EngineUtil.hx index 9f0e9157..ebfe916c 100644 --- a/source/funkin/backend/utils/EngineUtil.hx +++ b/source/funkin/backend/utils/EngineUtil.hx @@ -3,7 +3,7 @@ package funkin.backend.utils; import funkin.backend.scripting.MultiThreadedScript; import funkin.backend.scripting.Script; -class EngineUtil { +final class EngineUtil { /** * Starts a new multithreaded script. * This script will share all the variables with the current one, which means already existing callbacks will be replaced by new ones on conflict. diff --git a/source/funkin/backend/utils/HttpUtil.hx b/source/funkin/backend/utils/HttpUtil.hx index f2d3caf8..b48fc3d9 100644 --- a/source/funkin/backend/utils/HttpUtil.hx +++ b/source/funkin/backend/utils/HttpUtil.hx @@ -2,7 +2,7 @@ package funkin.backend.utils; import haxe.Http; -class HttpUtil +final class HttpUtil { public static var userAgent:String = "request"; public static function requestText(url:String) diff --git a/source/funkin/backend/utils/IniUtil.hx b/source/funkin/backend/utils/IniUtil.hx index d7b5738e..646a91b4 100644 --- a/source/funkin/backend/utils/IniUtil.hx +++ b/source/funkin/backend/utils/IniUtil.hx @@ -3,7 +3,7 @@ package funkin.backend.utils; /** * DOESNT SUPPORT CATEGORIES YET!! */ -class IniUtil { +final class IniUtil { public static inline function parseAsset(assetPath:String, ?defaultVariables:Map) return parseString(Assets.getText(assetPath), defaultVariables); diff --git a/source/funkin/backend/utils/MarkdownUtil.hx b/source/funkin/backend/utils/MarkdownUtil.hx index c3692f38..e481198d 100644 --- a/source/funkin/backend/utils/MarkdownUtil.hx +++ b/source/funkin/backend/utils/MarkdownUtil.hx @@ -3,7 +3,7 @@ package funkin.backend.utils; import flixel.text.FlxText; import flixel.util.FlxColor; -class MarkdownUtil { +final class MarkdownUtil { public static function applyMarkdownText(text:FlxText, str:String) { text.textField.htmlText = Markdown.markdownToHtml(prepareMarkdown(str)); var changes:Array = [ diff --git a/source/funkin/backend/utils/MathUtil.hx b/source/funkin/backend/utils/MathUtil.hx index aba4736b..06b4e83a 100644 --- a/source/funkin/backend/utils/MathUtil.hx +++ b/source/funkin/backend/utils/MathUtil.hx @@ -2,7 +2,7 @@ package funkin.backend.utils; import haxe.macro.Expr; -class MathUtil { +final class MathUtil { /** * Returns the maximum value in the arguments. * @param args Array of values diff --git a/source/funkin/backend/utils/MatrixUtil.hx b/source/funkin/backend/utils/MatrixUtil.hx index 9005c663..41cd5f1f 100644 --- a/source/funkin/backend/utils/MatrixUtil.hx +++ b/source/funkin/backend/utils/MatrixUtil.hx @@ -9,7 +9,7 @@ interface IPrePostDraw { public function postDraw():Void; } -class MatrixUtil { +final class MatrixUtil { public static function getMatrixPosition(sprite:FlxSprite, points:OneOfTwo>, ?camera:FlxCamera, _width:Float = 1, _height:Float = 1):Array { //if(_width == -1) _width = sprite.width; diff --git a/source/funkin/backend/utils/MemoryUtil.hx b/source/funkin/backend/utils/MemoryUtil.hx index 85f7d145..81a6087a 100644 --- a/source/funkin/backend/utils/MemoryUtil.hx +++ b/source/funkin/backend/utils/MemoryUtil.hx @@ -14,7 +14,7 @@ import openfl.system.System; using StringTools; -class MemoryUtil { +final class MemoryUtil { public static var disableCount:Int = 0; public static function askDisable() { diff --git a/source/funkin/backend/utils/NdllUtil.hx b/source/funkin/backend/utils/NdllUtil.hx index 97ab5d3e..c0cf1907 100644 --- a/source/funkin/backend/utils/NdllUtil.hx +++ b/source/funkin/backend/utils/NdllUtil.hx @@ -14,7 +14,7 @@ package funkin.backend.utils; * - The Function cannot be found in the NDLL * then an empty function will be returned instead, and a message will be shown in logs. */ -class NdllUtil { +final class NdllUtil { #if NDLLS_SUPPORTED #if windows public static final os:String = "windows"; #end #if linux public static final os:String = "linux"; #end diff --git a/source/funkin/backend/utils/ShaderResizeFix.hx b/source/funkin/backend/utils/ShaderResizeFix.hx index 96242859..97fc73fe 100644 --- a/source/funkin/backend/utils/ShaderResizeFix.hx +++ b/source/funkin/backend/utils/ShaderResizeFix.hx @@ -2,7 +2,7 @@ package funkin.backend.utils; import openfl.display.Sprite; -class ShaderResizeFix { +final class ShaderResizeFix { public static var doResizeFix:Bool = true; public static function init() { diff --git a/source/funkin/backend/utils/SortedArrayUtil.hx b/source/funkin/backend/utils/SortedArrayUtil.hx index ac317811..eee8b5ec 100644 --- a/source/funkin/backend/utils/SortedArrayUtil.hx +++ b/source/funkin/backend/utils/SortedArrayUtil.hx @@ -3,7 +3,7 @@ package funkin.backend.utils; /** * All types of utils only usable in a sorted array. */ -class SortedArrayUtil { +final class SortedArrayUtil { /** * Gets the index of a possible new element of an Array of T using an efficient algorithm. * @param array Array of T to check in diff --git a/source/funkin/backend/utils/ThreadUtil.hx b/source/funkin/backend/utils/ThreadUtil.hx index fe2cb5bf..8c2f654c 100644 --- a/source/funkin/backend/utils/ThreadUtil.hx +++ b/source/funkin/backend/utils/ThreadUtil.hx @@ -1,7 +1,7 @@ package funkin.backend.utils; #if ALLOW_MULTITHREADING -class ThreadUtil { +final class ThreadUtil { /** * Creates a new Thread with an error handler. * @param func Function to execute diff --git a/source/funkin/backend/utils/WindowUtils.hx b/source/funkin/backend/utils/WindowUtils.hx index d6210d9a..bf4d2730 100644 --- a/source/funkin/backend/utils/WindowUtils.hx +++ b/source/funkin/backend/utils/WindowUtils.hx @@ -2,7 +2,7 @@ package funkin.backend.utils; import openfl.Lib; -class WindowUtils { +final class WindowUtils { public static var winTitle(default, set):String; private static function set_winTitle(value:String):String { winTitle = value; diff --git a/source/funkin/backend/utils/XMLUtil.hx b/source/funkin/backend/utils/XMLUtil.hx index 52a3bd47..b09d2b4a 100644 --- a/source/funkin/backend/utils/XMLUtil.hx +++ b/source/funkin/backend/utils/XMLUtil.hx @@ -15,7 +15,7 @@ typedef TextFormat = { text:String, format:Dynamic } /** * Class made to make XML parsing easier. */ -class XMLUtil { +final class XMLUtil { /** * Applies a property XML node to an object. diff --git a/source/funkin/backend/utils/ZipUtil.hx b/source/funkin/backend/utils/ZipUtil.hx index 16a353c2..f7c5f9e3 100644 --- a/source/funkin/backend/utils/ZipUtil.hx +++ b/source/funkin/backend/utils/ZipUtil.hx @@ -23,7 +23,7 @@ using StringTools; // import ZipUtils; ZipUtils.uncompressZip(ZipUtils.openZip("E:\\Desktop\\test\\termination lua.ycemod"), "E:\\Desktop\\test\\uncompressed\\"); // import ZipUtils; var e = ZipUtils.createZipFile("gjnsdghs.ycemod"); ZipUtils.writeFolderToZip(e, "./mods/Friday Night Funkin'/", "Friday Night Funkin'/"); e.flush(); e.close(); -class ZipUtil { +final class ZipUtil { public static var bannedNames:Array = [".git", ".gitignore", ".github", ".vscode", ".gitattributes", "readme.txt"]; /** diff --git a/source/funkin/backend/utils/native/Linux.hx b/source/funkin/backend/utils/native/Linux.hx index 01e6a84b..661c5842 100644 --- a/source/funkin/backend/utils/native/Linux.hx +++ b/source/funkin/backend/utils/native/Linux.hx @@ -2,7 +2,8 @@ package funkin.backend.utils.native; #if linux @:cppFileCode("#include ") -class Linux { +@:dox(hide) +final class Linux { @:functionCode(' FILE *meminfo = fopen("/proc/meminfo", "r"); diff --git a/source/funkin/backend/utils/native/Mac.hx b/source/funkin/backend/utils/native/Mac.hx index abdb478c..b682d7ac 100644 --- a/source/funkin/backend/utils/native/Mac.hx +++ b/source/funkin/backend/utils/native/Mac.hx @@ -5,7 +5,8 @@ import funkin.backend.utils.NativeAPI.CodeCursor; import openfl.ui.Mouse; @:headerInclude('sys/sysctl.h') -class Mac +@:dox(hide) +final class Mac { @:functionCode(' int mib [] = { CTL_HW, HW_MEMSIZE }; diff --git a/source/funkin/backend/utils/native/Windows.hx b/source/funkin/backend/utils/native/Windows.hx index a536c75f..eb0b8cf0 100644 --- a/source/funkin/backend/utils/native/Windows.hx +++ b/source/funkin/backend/utils/native/Windows.hx @@ -114,7 +114,7 @@ class AudioFixClient : public IMMNotificationClient { AudioFixClient *curAudioFix; ') @:dox(hide) -class Windows { +final class Windows { public static var __audioChangeCallback:Void->Void = function() { trace("test"); diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 1e4adff3..a6bbe70a 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -1,6 +1,7 @@ package funkin.editors.charter; // ! FUCK YOU CHUF (your biggest fan -lunar) <3 +import flixel.FlxLayer; import funkin.editors.extra.CameraHoverDummy; import flixel.input.keyboard.FlxKey; import flixel.math.FlxPoint; @@ -88,6 +89,8 @@ class Charter extends UIState { public static var clipboard:Array = []; public static var waveformHandler:CharterWaveformHandler; + public var textLayer:FlxLayer; + public function new(song:String, diff:String, reload:Bool = true) { super(); if (song != null) { @@ -484,6 +487,7 @@ class Charter extends UIState { // adds grid and notes so that they're ALWAYS behind the UI add(gridBackdrops); + add(textLayer = new FlxLayer()); add(eventsBackdrop); add(addEventSpr); add(eventsGroup); diff --git a/source/funkin/editors/charter/CharterBackdropGroup.hx b/source/funkin/editors/charter/CharterBackdropGroup.hx index fb5c96e6..94d3dc09 100644 --- a/source/funkin/editors/charter/CharterBackdropGroup.hx +++ b/source/funkin/editors/charter/CharterBackdropGroup.hx @@ -6,6 +6,37 @@ import funkin.backend.system.Conductor; import openfl.geom.Rectangle; import funkin.backend.shaders.CustomShader; +class FlxFastTypedGroup extends FlxTypedGroup { + public function new(?maxSize:Int = 0) { + super(maxSize); + } + + override public function add(Object:T):T + { + if (Object == null) + { + FlxG.log.warn("Cannot add a `null` object to a FlxGroup."); + return null; + } + + // removed the check for multiple + // removed the check for null reuse + + // If the group is full, return the Object + if (maxSize > 0 && length >= maxSize) + return Object; + + // If we made it this far, we need to add the object to the group. + members.push(Object); + length++; + + if (_memberAdded != null) + _memberAdded.dispatch(Object); + + return Object; + } +} + class CharterBackdropGroup extends FlxTypedGroup { public var strumLineGroup:CharterStrumLineGroup; public var notesGroup:CharterNoteGroup; @@ -56,9 +87,11 @@ class CharterBackdropGroup extends FlxTypedGroup { grid.notesGroup.clear(); notesGroup.forEach((n) -> { - var onStr:Bool = (n.snappedToStrumline ? n.strumLineID : CoolUtil.boundInt(Std.int((n.x+n.width)/(40*strumLine.keyCount)), 0, strumLineGroup.members.length-1)) == i; - if(n.exists && n.visible && onStr) - grid.notesGroup.add(n); + if(n.exists && n.visible) { + var onStr:Bool = (n.snappedToStrumline ? n.strumLineID : CoolUtil.boundInt(Std.int((n.x+n.width)/(40*strumLine.keyCount)), 0, strumLineGroup.members.length-1)) == i; + if(onStr) + grid.notesGroup.add(n); + } }); grid.active = grid.visible = true; @@ -97,7 +130,7 @@ class CharterBackdropGroup extends FlxTypedGroup { } } -class CharterBackdrop extends FlxTypedGroup { +class CharterBackdrop extends FlxTypedGroup { public var gridBackDrop:FlxBackdrop; public var topLimit:FlxSprite; public var topSeparator:FlxSprite; @@ -110,7 +143,7 @@ class CharterBackdrop extends FlxTypedGroup { public var beatSeparator:FlxBackdrop; public var sectionSeparator:FlxBackdrop; - public var notesGroup:FlxTypedGroup = new FlxTypedGroup(); + public var notesGroup:FlxFastTypedGroup = new FlxFastTypedGroup(); public var strumLine:CharterStrumline; public var gridShader:CustomShader = new CustomShader("engine/charterGrid"); @@ -127,7 +160,7 @@ class CharterBackdrop extends FlxTypedGroup { waveformSprite = new FlxSprite().makeSolid(1, 1, 0xFF000000); waveformSprite.scale.set(160, 1); - waveformSprite.updateHitbox(); + waveformSprite.updateHitbox(); add(waveformSprite); sectionSeparator = new FlxBackdrop(null, Y, 0, 0); diff --git a/source/funkin/editors/charter/CharterDeleteAnim.hx b/source/funkin/editors/charter/CharterDeleteAnim.hx index 88bde691..6175bf9b 100644 --- a/source/funkin/editors/charter/CharterDeleteAnim.hx +++ b/source/funkin/editors/charter/CharterDeleteAnim.hx @@ -65,12 +65,17 @@ class CharterDeleteAnim extends CharterNote { sustainSpr.updateHitbox(); sustainSpr.follow(this, 15, 20); sustainSpr.exists = deleteData.note.susLength != 0; sustainSpr.alpha = .8; - typeText.text = Std.string(deleteData.note.type); - typeText.exists = deleteData.note.type != 0; typeText.alpha = .4; - typeText.follow(this, 20 - (typeText.frameWidth/2), 20 - (typeText.frameHeight/2)); + type = deleteData.note.type; + typeAlpha = .4; + //typeText.text = Std.string(deleteData.note.type); + //typeText.exists = deleteData.note.type != 0; typeAlpha = .4; + //typeText.follow(this, 20 - (typeText.frameWidth/2), 20 - (typeText.frameHeight/2)); - for (member in [this, sustainSpr, typeText]) - member.alpha *= FlxEase.quadInOut(deleteData.time/deleteTime); + var mult = FlxEase.quadInOut(deleteData.time/deleteTime); + + for (member in [this, sustainSpr]) + member.alpha *= mult; + typeAlpha *= mult; super.draw(); } diff --git a/source/funkin/editors/charter/CharterEventScreen.hx b/source/funkin/editors/charter/CharterEventScreen.hx index 18b2db21..77cb4ba2 100644 --- a/source/funkin/editors/charter/CharterEventScreen.hx +++ b/source/funkin/editors/charter/CharterEventScreen.hx @@ -5,6 +5,8 @@ import flixel.util.FlxColor; import funkin.backend.chart.ChartData.ChartEvent; import funkin.backend.chart.EventsData; import funkin.backend.system.Conductor; +import funkin.game.Character; +import funkin.game.Stage; using StringTools; @@ -163,6 +165,20 @@ class CharterEventScreen extends UISubstateWindow { var dropdown = new UIDropDown(eventName.x, y, 320, 32, options, Std.int(Math.abs(options.indexOf(cast value)))); paramsPanel.add(dropdown); paramsFields.push(dropdown); dropdown; + case TCharacter: + addLabel(); + var charFileList = Character.getList(false); + var textBox:UIAutoCompleteTextBox = new UIAutoCompleteTextBox(eventName.x, y, cast value); + textBox.suggestItems = charFileList; + paramsPanel.add(textBox); paramsFields.push(textBox); + textBox; + case TStage: + addLabel(); + var stageFileList = Stage.getList(false); + var textBox:UIAutoCompleteTextBox = new UIAutoCompleteTextBox(eventName.x, y, cast value); + textBox.suggestItems = stageFileList; + paramsPanel.add(textBox); paramsFields.push(textBox); + textBox; default: paramsFields.push(null); null; diff --git a/source/funkin/editors/charter/CharterNote.hx b/source/funkin/editors/charter/CharterNote.hx index 702aa946..bc1bb4e0 100644 --- a/source/funkin/editors/charter/CharterNote.hx +++ b/source/funkin/editors/charter/CharterNote.hx @@ -29,6 +29,8 @@ class CharterNote extends UISprite implements ICharterSelectable { public var selected:Bool = false; public var draggable:Bool = true; + static var noteTypeTexts:Array = []; + public function new() { super(); @@ -43,7 +45,7 @@ class CharterNote extends UISprite implements ICharterSelectable { sustainSpr.scale.set(10, 0); members.push(sustainSpr); - typeText = new UIText(x, y, 0, Std.string(type)); + this.type = 0; cursor = sustainSpr.cursor = CLICK; moves = false; @@ -57,7 +59,22 @@ class CharterNote extends UISprite implements ICharterSelectable { public var step:Float; public var id:Int; public var susLength:Float; - public var type:Int; + public var type(default, set):Null = null; + public var typeVisible:Bool = true; + public var typeAlpha:Float = 1; + + function set_type(v:Null) { + if(v != this.type) { + if(noteTypeTexts[v] == null || noteTypeTexts[v].graphic.isDestroyed) { + noteTypeTexts[v] = new UIText(x, y, 0, Std.string(v)); + noteTypeTexts[v].exists = v != 0; + noteTypeTexts[v].layer = (Charter.instance != null) ? Charter.instance.textLayer : null; + } + + typeText = noteTypeTexts[v]; + } + return this.type = v; + } public var strumLine:CharterStrumline; public var strumLineID(get, default):Int = -1; @@ -77,9 +94,7 @@ class CharterNote extends UISprite implements ICharterSelectable { this.type = type; if (strumLine != null) this.strumLine = strumLine; - typeText.exists = type != 0; - typeText.text = Std.string(this.type); - typeText.follow(this, 20 - (typeText.frameWidth/2), 20 - (typeText.frameHeight/2)); + sustainSpr.exists = susLength != 0; y = step * 40; @@ -132,10 +147,12 @@ class CharterNote extends UISprite implements ICharterSelectable { public override function update(elapsed:Float) { super.update(elapsed); - var sprLength:Float = (40 * (susLength+tempSusLength)) + ((susLength+tempSusLength) != 0 ? (height/2) : 0); - sustainSpr.scale.set(10, __susInstaLerp ? sprLength : CoolUtil.fpsLerp(sustainSpr.scale.y, sprLength, 1/2)); - sustainSpr.updateHitbox(); - sustainSpr.follow(this, 15, 20); + if(susLength != 0) { + var sprLength:Float = (40 * (susLength+tempSusLength)) + ((susLength+tempSusLength) != 0 ? (height/2) : 0); + sustainSpr.scale.set(10, __susInstaLerp ? sprLength : CoolUtil.fpsLerp(sustainSpr.scale.y, sprLength, 1/2)); + sustainSpr.updateHitbox(); + sustainSpr.follow(this, 15, 20); + } sustainDraggable = false; if (!hovered && susLength != 0) { @@ -143,9 +160,6 @@ class CharterNote extends UISprite implements ICharterSelectable { sustainDraggable = UIState.state.isOverlapping(sustainSpr, @:privateAccess sustainSpr.__rect); } - if (typeText.exists) - typeText.follow(this, 20 - (typeText.frameWidth/2), 20 - (typeText.frameHeight/2)); - if (__passed != (__passed = step < Conductor.curStepFloat)) { if (__passed && FlxG.sound.music.playing && Charter.instance.hitsoundsEnabled(strumLineID)) Charter.instance.hitsound.replay(); @@ -153,7 +167,7 @@ class CharterNote extends UISprite implements ICharterSelectable { if (strumLine != null) { sustainSpr.alpha = alpha = !strumLine.strumLine.visible ? (__passed ? 0.2 : 0.4) : (__passed ? 0.6 : 1); - typeText.alpha = !strumLine.strumLine.visible ? (__passed ? 0.4 : 0.6) : (__passed ? 0.8 : 1); + typeAlpha = !strumLine.strumLine.visible ? (__passed ? 0.4 : 0.6) : (__passed ? 0.8 : 1); } colorTransform.redMultiplier = colorTransform.greenMultiplier = colorTransform.blueMultiplier = selected ? 0.75 : 1; @@ -186,6 +200,10 @@ class CharterNote extends UISprite implements ICharterSelectable { drawMembers(); drawSuper(); - if(typeText.exists && typeText.visible) typeText.draw(); + if(typeText.exists && typeText.visible && typeVisible) { + typeText.alpha = typeAlpha; + typeText.follow(this, 20 - (typeText.frameWidth/2), 20 - (typeText.frameHeight/2)); + typeText.draw(); + } } } \ No newline at end of file diff --git a/source/funkin/editors/charter/CharterNoteHoverer.hx b/source/funkin/editors/charter/CharterNoteHoverer.hx index b358d3a7..3341e8d0 100644 --- a/source/funkin/editors/charter/CharterNoteHoverer.hx +++ b/source/funkin/editors/charter/CharterNoteHoverer.hx @@ -7,7 +7,7 @@ class CharterNoteHoverer extends CharterNote { super(); snappedToStrumline = selectable = autoAlpha = false; visible = sustainSpr.visible = false; - @:privateAccess __animSpeed = 1.25; typeText.visible = false; alpha = 0.4; + @:privateAccess __animSpeed = 1.25; typeVisible = false; alpha = 0.4; } @:noCompletion var __mousePos:FlxPoint = FlxPoint.get(); @@ -19,7 +19,7 @@ class CharterNoteHoverer extends CharterNote { var inBoundsY:Bool = (__mousePos.y > 0 && __mousePos.y < (Charter.instance.__endStep)*40); if ((__mousePos.x > 0 && __mousePos.x < Charter.instance.strumLines.totalKeyCount * 40 && inBoundsY) && showHoverer) { step = CoolUtil.bound(FlxG.keys.pressed.SHIFT ? ((__mousePos.y-20) / 40) : Charter.instance.quantStep(__mousePos.y/40), 0, Charter.instance.__endStep-1); - id = Math.floor(__mousePos.x / 40); y = step * 40; x = id * 40; visible = true; sustainSpr.visible = typeText.visible = false; + id = Math.floor(__mousePos.x / 40); y = step * 40; x = id * 40; visible = true; sustainSpr.visible = typeVisible = false; angle = switch(animation.curAnim.curFrame = ((id - Charter.instance.strumLines.getStrumlineFromID(id).startingID) % 4)) { case 0: -90; case 1: 180; @@ -30,9 +30,9 @@ class CharterNoteHoverer extends CharterNote { } else visible = false; case NOTE_DRAG: - visible = sustainSpr.visible = typeText.visible = true; __doAnim = false; + visible = sustainSpr.visible = typeVisible = true; __doAnim = false; default: - visible = sustainSpr.visible = typeText.visible = false; __doAnim = false; + visible = sustainSpr.visible = typeVisible = false; __doAnim = false; } } diff --git a/source/funkin/editors/ui/UIState.hx b/source/funkin/editors/ui/UIState.hx index e2e580af..47324848 100644 --- a/source/funkin/editors/ui/UIState.hx +++ b/source/funkin/editors/ui/UIState.hx @@ -28,6 +28,8 @@ class UIState extends MusicBeatState { private var __rect:FlxRect; private var __mousePos:FlxPoint; + static var __point:FlxPoint = new FlxPoint(); + private inline static function get_state() return FlxG.state is UIState ? cast FlxG.state : null; @@ -70,17 +72,15 @@ class UIState extends MusicBeatState { public function isOverlapping(spr:UISprite, rect:FlxRect) { for(camera in spr.__lastDrawCameras) { - var pos = FlxG.mouse.getScreenPosition(camera, FlxPoint.get()); + var pos = FlxG.mouse.getScreenPosition(camera, __point); __rect.copyFrom(rect); __rect.x -= camera.scroll.x * spr.scrollFactor.x; __rect.y -= camera.scroll.y * spr.scrollFactor.y; if (((pos.x > __rect.x) && (pos.x < __rect.x + __rect.width)) && ((pos.y > __rect.y) && (pos.y < __rect.y + __rect.height))) { - pos.put(); return true; } - pos.put(); } return false; } diff --git a/source/funkin/game/HealthIcon.hx b/source/funkin/game/HealthIcon.hx index d55bf14b..1c7bb59d 100644 --- a/source/funkin/game/HealthIcon.hx +++ b/source/funkin/game/HealthIcon.hx @@ -24,6 +24,11 @@ class HealthIcon extends FlxSprite */ public var healthSteps:Map = null; + /** + * current animation state + */ + public var curAnimState:Int = -1; + /** * Helper for HScript who can't make maps * @param steps Something like this: `[[0, 1], [20, 0]]` @@ -91,7 +96,14 @@ class HealthIcon extends FlxSprite i = icon; } } - if (i >= 0) animation.curAnim.curFrame = i; + if (i >= 0 && curAnimState != i) { + var event = EventManager.get(funkin.backend.scripting.events.HealthIconChangeEvent).recycle(i, this); + funkin.backend.scripting.GlobalScript.event("onHealthIconAnimChange", event); + if (!event.cancelled) + animation.curAnim.curFrame = event.amount; + + curAnimState = event.amount; + } } } } diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 46309f5a..c1f2537a 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1428,6 +1428,8 @@ class PlayState extends MusicBeatState FlxG.sound.music.stop(); for (strumLine in strumLines.members) strumLine.vocals.stop(); + deathCounter++; + openSubState(new GameOverSubstate(event.x, event.y, event.deathCharID, event.isPlayer, event.gameOverSong, event.lossSFX, event.retrySFX)); scripts.event("onPostGameOver", event); diff --git a/source/funkin/game/SplashHandler.hx b/source/funkin/game/SplashHandler.hx index dc6f7533..1776bdb8 100644 --- a/source/funkin/game/SplashHandler.hx +++ b/source/funkin/game/SplashHandler.hx @@ -40,7 +40,10 @@ class SplashHandler extends FlxTypedGroup { var __grp:SplashGroup; public function showSplash(name:String, strum:Strum) { __grp = getSplashGroup(name); - add(__grp.showOnStrum(strum)); + var event = funkin.backend.scripting.EventManager.get(funkin.backend.scripting.events.DynamicEvent).recycle(__grp.showOnStrum(strum), strum); + event = PlayState.instance.scripts.event("onSplashShown", event); + if (!event.cancelled) + add(event.value1); // max 8 rendered splashes while(members.length > 8) diff --git a/source/funkin/game/Strum.hx b/source/funkin/game/Strum.hx index 448e4bb6..e765264b 100644 --- a/source/funkin/game/Strum.hx +++ b/source/funkin/game/Strum.hx @@ -14,6 +14,8 @@ class Strum extends FlxSprite { public var cpu = false; // Unused public var lastHit:Float = -5000; + public var strumLine = null; + public var scrollSpeed:Null = null; // custom scroll speed per strum public var noteAngle:Null = null; diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index 5567095f..4d2694de 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -148,6 +148,11 @@ class StrumLine extends FlxTypedGroup { } } notes.sortNotes(); + + var scrollSpeed = strumLine.scrollSpeed; + if(scrollSpeed == null) if (PlayState.instance != null) scrollSpeed = PlayState.instance.scrollSpeed; + if(scrollSpeed == null) scrollSpeed = 1; + notes.limit = 1500 / scrollSpeed; } public override function update(elapsed:Float) { @@ -179,10 +184,11 @@ class StrumLine extends FlxTypedGroup { if (__updateNote_event.cancelled) return; if (__updateNote_event.__updateHitWindow) { - daNote.canBeHit = (daNote.strumTime > __updateNote_songPos - (PlayState.instance.hitWindow * daNote.latePressWindow) - && daNote.strumTime < __updateNote_songPos + (PlayState.instance.hitWindow * daNote.earlyPressWindow)); + var hitWindow = PlayState.instance.hitWindow; + daNote.canBeHit = (daNote.strumTime > __updateNote_songPos - (hitWindow * daNote.latePressWindow) + && daNote.strumTime < __updateNote_songPos + (hitWindow * daNote.earlyPressWindow)); - if (daNote.strumTime < __updateNote_songPos - PlayState.instance.hitWindow && !daNote.wasGoodHit) + if (daNote.strumTime < __updateNote_songPos - hitWindow && !daNote.wasGoodHit) daNote.tooLate = true; } @@ -303,6 +309,7 @@ class StrumLine extends FlxTypedGroup { animPrefix = strumAnimPrefix[i % strumAnimPrefix.length]; var babyArrow:Strum = new Strum(startingPos.x + ((Note.swagWidth * strumScale * (4 / (data.keyCount != null ? data.keyCount : 4))) * i), startingPos.y); babyArrow.ID = i; + babyArrow.strumLine = this; if(data.scrollSpeed != null) babyArrow.scrollSpeed = data.scrollSpeed; diff --git a/source/funkin/game/cutscenes/VideoCutscene.hx b/source/funkin/game/cutscenes/VideoCutscene.hx index f9834cbf..f12210eb 100644 --- a/source/funkin/game/cutscenes/VideoCutscene.hx +++ b/source/funkin/game/cutscenes/VideoCutscene.hx @@ -56,8 +56,13 @@ class VideoCutscene extends Cutscene { parseSubtitles(); video = new FlxVideo(); - video.onEndReached.add(video.dispose); + video.onEndReached.add(function() + { + video.dispose(); + FlxG.removeChild(video); + }); video.onEndReached.add(close); + FlxG.addChildBelowMouse(video); //cover = new FlxSprite(0, FlxG.height * 0.85).makeSolid(FlxG.width + 50, FlxG.height + 50, 0xFF000000); //cover.scrollFactor.set(0, 0); diff --git a/source/funkin/menus/FreeplayState.hx b/source/funkin/menus/FreeplayState.hx index 24e93b4f..d29cd108 100644 --- a/source/funkin/menus/FreeplayState.hx +++ b/source/funkin/menus/FreeplayState.hx @@ -196,6 +196,10 @@ class FreeplayState extends MusicBeatState * Path to the currently playing song instrumental. */ public var curPlayingInst:String = null; + /** + * If it should play the song automatically. + */ + public var autoplayShouldPlay:Bool = true; #end override function update(elapsed:Float) @@ -236,7 +240,17 @@ class FreeplayState extends MusicBeatState autoplayElapsed += elapsed; if (!disableAutoPlay && !songInstPlaying && (autoplayElapsed > timeUntilAutoplay || FlxG.keys.justPressed.SPACE)) { if (curPlayingInst != (curPlayingInst = Paths.inst(songs[curSelected].name, songs[curSelected].difficulties[curDifficulty]))) { - var huh:Void->Void = function() FlxG.sound.playMusic(curPlayingInst, 0); + var huh:Void->Void = function() { + var soundPath = curPlayingInst; + var sound = null; + if (Assets.exists(soundPath, SOUND) || Assets.exists(soundPath, MUSIC)) + sound = Assets.getSound(soundPath); + else + FlxG.log.error('Could not find a Sound asset with an ID of \'$soundPath\'.'); + + if (sound != null && autoplayShouldPlay) + FlxG.sound.playMusic(sound, 0); + } if(!disableAsyncLoading) Main.execAsync(huh); else huh(); } @@ -289,6 +303,10 @@ class FreeplayState extends MusicBeatState if (event.cancelled) return; + #if PRELOAD_ALL + autoplayShouldPlay = false; + #end + Options.freeplayLastSong = songs[curSelected].name; Options.freeplayLastDifficulty = songs[curSelected].difficulties[curDifficulty]; diff --git a/source/funkin/menus/MainMenuState.hx b/source/funkin/menus/MainMenuState.hx index 2f5ea12c..27391e0a 100644 --- a/source/funkin/menus/MainMenuState.hx +++ b/source/funkin/menus/MainMenuState.hx @@ -19,8 +19,10 @@ class MainMenuState extends MusicBeatState var optionShit:Array = CoolUtil.coolTextFile(Paths.txt("config/menuItems")); + var bg:FlxSprite; var magenta:FlxSprite; var camFollow:FlxObject; + var versionText:FunkinText; public var canAccessDebugMenus:Bool = true; @@ -32,7 +34,7 @@ class MainMenuState extends MusicBeatState CoolUtil.playMenuSong(); - var bg:FlxSprite = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBG')); + bg = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBG')); add(bg); camFollow = new FlxObject(0, 0, 1, 1); @@ -70,15 +72,16 @@ class MainMenuState extends MusicBeatState FlxG.camera.follow(camFollow, null, 0.06); - var versionShit:FunkinText = new FunkinText(5, FlxG.height - 2, 0, 'Codename Engine v${Application.current.meta.get('version')}\nCommit ${funkin.backend.system.macros.GitCommitMacro.commitNumber} (${funkin.backend.system.macros.GitCommitMacro.commitHash})\n[${controls.getKeyName(SWITCHMOD)}] Open Mods menu\n'); - versionShit.y -= versionShit.height; - versionShit.scrollFactor.set(); - add(versionShit); + versionText = new FunkinText(5, FlxG.height - 2, 0, 'Codename Engine v${Application.current.meta.get('version')}\nCommit ${funkin.backend.system.macros.GitCommitMacro.commitNumber} (${funkin.backend.system.macros.GitCommitMacro.commitHash})\n[${controls.getKeyName(SWITCHMOD)}] Open Mods menu\n'); + versionText.y -= versionText.height; + versionText.scrollFactor.set(); + add(versionText); changeItem(); } var selectedSomethin:Bool = false; + var forceCenterX:Bool = true; override function update(elapsed:Float) { @@ -127,6 +130,7 @@ class MainMenuState extends MusicBeatState super.update(elapsed); + if (forceCenterX) menuItems.forEach(function(spr:FlxSprite) { spr.screenCenter(X); diff --git a/source/lime/utils/ObjectPool.hx b/source/lime/utils/ObjectPool.hx new file mode 100644 index 00000000..f05715c3 --- /dev/null +++ b/source/lime/utils/ObjectPool.hx @@ -0,0 +1,347 @@ +package lime.utils; + +import haxe.ds.ObjectMap; + + +/** + A generic object pool for reusing objects. + **/ +#if !lime_debug +@:fileXml('tags="haxe,release"') +@:noDebug +#end +#if !js @:generic #end class ObjectPool +{ + /** + The number of active objects in the pool. + **/ + public var activeObjects(default, null):Int; + + /** + The number of inactive objects in the pool. + **/ + public var inactiveObjects(default, null):Int; + + /** + The total size of the object pool (both active and inactive objects). + **/ + public var size(get, set):Null; + + @:noCompletion private var __inactiveObject0:T; + @:noCompletion private var __inactiveObject1:T; + @:noCompletion private var __inactiveObjectList:List; + @:noCompletion private var __pool:Map; + @:noCompletion private var __size:Null; + + /** + Creates a new ObjectPool instance. + + @param create A function that creates a new instance of type T. + @param clean A function that cleans up an instance of type T before it is reused. + @param size The maximum size of the object pool. + **/ + public function new(create:Void->T = null, clean:T->Void = null, size:Null = null) + { + __pool = cast new ObjectMap(); + + activeObjects = 0; + inactiveObjects = 0; + + __inactiveObject0 = null; + __inactiveObject1 = null; + __inactiveObjectList = new List(); + + if (create != null) + { + this.create = create; + } + if (clean != null) + { + this.clean = clean; + } + if (size != null) + { + this.size = size; + } + } + /** + Adds an object to the object pool. + + @param object The object to add to the pool. + **/ + public function add(object:T):Void + { + if (object != null && !__pool.exists(object)) + { + __pool.set(object, false); + clean(object); + __addInactive(object); + } + } + + /** + Dynamic function. + + Cleans up an object before returning it to the pool. + + @param object The object to clean up. + **/ + public dynamic function clean(object:T):Void {} + + /** + Clears the object pool, removing all objects. + **/ + public function clear():Void + { + __pool = cast new ObjectMap(); + + activeObjects = 0; + inactiveObjects = 0; + + __inactiveObject0 = null; + __inactiveObject1 = null; + __inactiveObjectList.clear(); + } + + /** + Dynamic function. + + Creates a new Object. + **/ + public dynamic function create():T + { + return null; + } + + /** + Creates a new object and adds it to the pool, or returns an existing inactive object from the pool. + + @return The object retrieved from the pool, or null if the pool is full and no new objects can be created. + **/ + public function get():T + { + var object = null; + + if (inactiveObjects > 0) + { + object = __getInactive(); + } + else if (__size == null || activeObjects < __size) + { + object = create(); + + if (object != null) + { + __pool.set(object, true); + activeObjects++; + } + } + + return object; + } + + /** + Releases an active object back into the pool. + + @param object The object to release. + **/ + public function release(object:T):Void + { + #if lime_pool_debug + if (object == null || !__pool.exists(object)) + { + Log.error("Object is not a member of the pool"); + } + else if (!__pool.get(object)) + { + Log.error("Object has already been released"); + } + #end + + activeObjects--; + + if (__size == null || activeObjects + inactiveObjects < __size) + { + clean(object); + __addInactive(object); + } + else + { + __pool.remove(object); + } + } + + /** + Removes an object from the pool. + + @param object The object to remove from the pool. + **/ + public function remove(object:T):Void + { + if (object != null && __pool.exists(object)) + { + __pool.remove(object); + + if (__inactiveObject0 == object) + { + __inactiveObject0 = null; + inactiveObjects--; + } + else if (__inactiveObject1 == object) + { + __inactiveObject1 = null; + inactiveObjects--; + } + else if (__inactiveObjectList.remove(object)) + { + inactiveObjects--; + } + else + { + activeObjects--; + } + } + } + + @:noCompletion private inline function __addInactive(object:T):Void + { + #if lime_pool_debug + __pool.set(object, false); + #end + + if (__inactiveObject0 == null) + { + __inactiveObject0 = object; + } + else if (__inactiveObject1 == null) + { + __inactiveObject1 = object; + } + else + { + __inactiveObjectList.add(object); + } + + inactiveObjects++; + } + + @:noCompletion private inline function __getInactive():T + { + var object = null; + + if (__inactiveObject0 != null) + { + object = __inactiveObject0; + __inactiveObject0 = null; + } + else if (__inactiveObject1 != null) + { + object = __inactiveObject1; + __inactiveObject1 = null; + } + else + { + object = __inactiveObjectList.pop(); + + if (__inactiveObjectList.length > 0) + { + __inactiveObject0 = __inactiveObjectList.pop(); + } + + if (__inactiveObjectList.length > 0) + { + __inactiveObject1 = __inactiveObjectList.pop(); + } + } + + #if lime_pool_debug + __pool.set(object, true); + #end + + inactiveObjects--; + activeObjects++; + + return object; + } + + @:noCompletion private function __removeInactive(count:Int):Void + { + if (count <= 0 || inactiveObjects == 0) return; + + if (__inactiveObject0 != null) + { + __pool.remove(__inactiveObject0); + __inactiveObject0 = null; + inactiveObjects--; + count--; + } + + if (count == 0 || inactiveObjects == 0) return; + + if (__inactiveObject1 != null) + { + __pool.remove(__inactiveObject1); + __inactiveObject1 = null; + inactiveObjects--; + count--; + } + + if (count == 0 || inactiveObjects == 0) return; + + for (object in __inactiveObjectList) + { + __pool.remove(object); + __inactiveObjectList.remove(object); + inactiveObjects--; + count--; + + if (count == 0 || inactiveObjects == 0) return; + } + } + + // Get & Set Methods + @:noCompletion private function get_size():Null + { + return __size; + } + + @:noCompletion private function set_size(value:Null):Null + { + if (value == null) + { + __size = null; + } + else + { + var current = inactiveObjects + activeObjects; + __size = value; + + if (current > value) + { + __removeInactive(current - value); + } + else if (value > current) + { + var object; + + for (i in 0...(value - current)) + { + object = create(); + + if (object != null) + { + __pool.set(object, false); + __inactiveObjectList.add(object); + inactiveObjects++; + } + else + { + break; + } + } + } + } + + return value; + } +}