From 92162bfdadf23bb05023ff4f724fb1dd601ca7e6 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 28 Sep 2023 16:49:01 -0400 Subject: [PATCH 01/11] Fix crash handler without breaking HaxeUI --- hmm.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmm.json b/hmm.json index 47460facf..fdaf753f7 100644 --- a/hmm.json +++ b/hmm.json @@ -139,7 +139,7 @@ "name": "openfl", "type": "git", "dir": null, - "ref": "d33d489a137ff8fdece4994cf1302f0b6334ed08", + "ref": "de9395d2f367a80f93f082e1b639b9cde2258bf1", "url": "https://github.com/EliteMasterEric/openfl" }, { @@ -160,4 +160,4 @@ "version": "0.11.0" } ] -} \ No newline at end of file +} From b6752531bf9300397a2ed2c4e56be54e062b42b4 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 29 Sep 2023 22:29:32 -0400 Subject: [PATCH 02/11] Add chart editor theme --- assets | 2 +- .../charting/ChartEditorDialogHandler.hx | 5 ++++ .../ui/debug/charting/ChartEditorState.hx | 28 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/assets b/assets index a62e7e50d..e0e56cb3c 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit a62e7e50d59c14d256c75da651b79dea77e1620e +Subproject commit e0e56cb3cdb1b4394c744d5c1502cdb2629fa9b6 diff --git a/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx index 6f44f89a2..3bb945fc8 100644 --- a/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx @@ -83,6 +83,7 @@ class ChartEditorDialogHandler linkCreateBasic.onClick = function(_event) { // Hide the welcome dialog dialog.hideDialog(DialogButton.CANCEL); + state.stopWelcomeMusic(); // // Create Song Wizard @@ -95,6 +96,7 @@ class ChartEditorDialogHandler linkImportChartLegacy.onClick = function(_event) { // Hide the welcome dialog dialog.hideDialog(DialogButton.CANCEL); + state.stopWelcomeMusic(); // Open the "Import Chart" dialog openImportChartWizard(state, 'legacy', false); @@ -105,6 +107,7 @@ class ChartEditorDialogHandler buttonBrowse.onClick = function(_event) { // Hide the welcome dialog dialog.hideDialog(DialogButton.CANCEL); + state.stopWelcomeMusic(); // Open the "Open Chart" dialog openBrowseWizard(state, false); @@ -133,6 +136,7 @@ class ChartEditorDialogHandler linkTemplateSong.text = songName; linkTemplateSong.onClick = function(_event) { dialog.hideDialog(DialogButton.CANCEL); + state.stopWelcomeMusic(); // Load song from template state.loadSongAsTemplate(targetSongId); @@ -141,6 +145,7 @@ class ChartEditorDialogHandler splashTemplateContainer.addComponent(linkTemplateSong); } + state.fadeInWelcomeMusic(); return dialog; } diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index add65c5bf..e8887496e 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -751,6 +751,11 @@ class ChartEditorState extends HaxeUIState */ // ============================== + /** + * The chill audio track that plays when you open the Chart Editor. + */ + public var welcomeMusic:FlxSound = new FlxSound(); + /** * The audio track for the instrumental. * `null` until an instrumental track is loaded. @@ -1249,6 +1254,9 @@ class ChartEditorState extends HaxeUIState // Get rid of any music from the previous state. FlxG.sound.music.stop(); + // Play the welcome music. + setupWelcomeMusic(); + buildDefaultSongData(); buildBackground(); @@ -1273,6 +1281,26 @@ class ChartEditorState extends HaxeUIState ChartEditorDialogHandler.openWelcomeDialog(this, false); } + function setupWelcomeMusic() + { + this.welcomeMusic.loadEmbedded(Paths.music('chartEditorLoop/chartEditorLoop')); + this.welcomeMusic.looped = true; + // this.welcomeMusic.play(); + // fadeInWelcomeMusic(); + } + + public function fadeInWelcomeMusic():Void + { + this.welcomeMusic.play(); + this.welcomeMusic.fadeIn(4, 0, 1.0); + } + + public function stopWelcomeMusic():Void + { + // this.welcomeMusic.fadeOut(4, 0); + this.welcomeMusic.pause(); + } + function buildDefaultSongData():Void { selectedVariation = Constants.DEFAULT_VARIATION; From 50b579ed4fcc356079e7b2431d67817ccf0a6df6 Mon Sep 17 00:00:00 2001 From: Hazel Date: Thu, 5 Oct 2023 14:48:54 +0100 Subject: [PATCH 03/11] attempt using PAT for submodule checkout --- .github/workflows/build-shit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index ed509b44d..0d9f1f2a4 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -26,6 +26,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + token: ${{ secrets.GH_RO_PAT }} - uses: ./.github/actions/setup-haxeshit - name: Build game run: | @@ -48,6 +49,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + token: ${{ secrets.GH_RO_PAT }} - uses: ./.github/actions/setup-haxeshit - name: Build game run: | From 572dfb26564918e05430a815a0dfd0b98e79d835 Mon Sep 17 00:00:00 2001 From: Hazel Date: Thu, 5 Oct 2023 14:57:02 +0100 Subject: [PATCH 04/11] apt update --- .github/workflows/build-shit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index 0d9f1f2a4..e3dd51661 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -30,6 +30,7 @@ jobs: - uses: ./.github/actions/setup-haxeshit - name: Build game run: | + sudo apt-get update sudo apt-get install -y libx11-dev xorg-dev libgl-dev libxi-dev libxext-dev libasound2-dev libxinerama-dev libxrandr-dev libgl1-mesa-dev haxelib run lime build html5 -release --times ls From 6d7df09437c02e28c84870be64190538abe91609 Mon Sep 17 00:00:00 2001 From: Hazel Date: Thu, 5 Oct 2023 15:34:01 +0100 Subject: [PATCH 05/11] missed a checkout for unit tests --- .github/workflows/build-shit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index e3dd51661..0e365b281 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -71,6 +71,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + token: ${{ secrets.GH_RO_PAT }} - uses: ./.github/actions/setup-haxeshit - name: Run unit tests run: | From 66e9bf8716e2741296fedada929ec86ff0571428 Mon Sep 17 00:00:00 2001 From: Hazel Date: Thu, 5 Oct 2023 15:41:37 +0100 Subject: [PATCH 06/11] 64fast --- .github/workflows/build-shit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index 0e365b281..ab96ec9a3 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -42,7 +42,7 @@ jobs: create-nightly-win: needs: check_date if: ${{ needs.check_date.outputs.should_run != 'false'}} - runs-on: windows-latest + runs-on: 64fast permissions: contents: write actions: write @@ -63,7 +63,7 @@ jobs: target: win test-unit-win: needs: create-nightly-win - runs-on: windows-latest + runs-on: 64fast permissions: contents: write actions: write From 1e72c3d60065583421cd0a3779096185a9387c95 Mon Sep 17 00:00:00 2001 From: Hazel Date: Thu, 5 Oct 2023 15:54:13 +0100 Subject: [PATCH 07/11] 64fast is not worth it --- .github/actions/upload-itch/action.yml | 4 ++-- .github/workflows/build-shit.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/upload-itch/action.yml b/.github/actions/upload-itch/action.yml index 5abc31b16..af9a87b39 100644 --- a/.github/actions/upload-itch/action.yml +++ b/.github/actions/upload-itch/action.yml @@ -36,9 +36,9 @@ runs: ./butler -V shell: bash - name: Upload game to itch.io - env: + env: BUTLER_API_KEY: ${{inputs.butler-key}} run: | ./butler login ./butler push ${{inputs.build-dir}} ninja-muffin24/funkin-secret:${{inputs.target}}-${GITHUB_REF##*/} - shell: bash \ No newline at end of file + shell: bash diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index ab96ec9a3..0e365b281 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -42,7 +42,7 @@ jobs: create-nightly-win: needs: check_date if: ${{ needs.check_date.outputs.should_run != 'false'}} - runs-on: 64fast + runs-on: windows-latest permissions: contents: write actions: write @@ -63,7 +63,7 @@ jobs: target: win test-unit-win: needs: create-nightly-win - runs-on: 64fast + runs-on: windows-latest permissions: contents: write actions: write From af65b83ddd090c49b5884fa2e740c64511d2f30f Mon Sep 17 00:00:00 2001 From: Hazel Date: Thu, 5 Oct 2023 15:55:23 +0100 Subject: [PATCH 08/11] remove --quiet so i can see errors (woah) --- .github/actions/setup-haxeshit/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-haxeshit/action.yml b/.github/actions/setup-haxeshit/action.yml index 38a504442..e96181ce4 100644 --- a/.github/actions/setup-haxeshit/action.yml +++ b/.github/actions/setup-haxeshit/action.yml @@ -16,5 +16,5 @@ runs: haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git development haxelib version haxelib --global install hmm - haxelib --global run hmm install --quiet + haxelib --global run hmm install shell: bash From 2e97bb2d7b94c50e9dc15a75b500ffbad7e05527 Mon Sep 17 00:00:00 2001 From: Hazel Date: Fri, 6 Oct 2023 15:52:28 +0100 Subject: [PATCH 09/11] attempt i. at caching haxe installs --- .github/actions/setup-haxeshit/action.yml | 43 +++++++++++++++-------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/actions/setup-haxeshit/action.yml b/.github/actions/setup-haxeshit/action.yml index e96181ce4..756530178 100644 --- a/.github/actions/setup-haxeshit/action.yml +++ b/.github/actions/setup-haxeshit/action.yml @@ -3,18 +3,31 @@ description: "sets up haxe shit, using HMM!" runs: using: "composite" steps: - - uses: krdlab/setup-haxe@v1.5.1 - with: - haxe-version: 4.3.1 - - name: Config haxelib - run: | - haxelib config - shell: bash - - name: Installing Haxe lol - run: | - haxe -version - haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git development - haxelib version - haxelib --global install hmm - haxelib --global run hmm install - shell: bash + - uses: krdlab/setup-haxe@v1.5.1 + with: + haxe-version: 4.3.1 + - name: Config haxelib + run: | + haxelib config + shell: bash + - name: Installing Haxe lol + run: | + haxe -version + haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git development + haxelib version + haxelib --global install hmm + shell: bash + - name: dependency install cache + id: cache-hmm + uses: actions/cache@v3 + with: + path: .haxelib + key: ${{ runner.os }}-hmm-${{ hashFiles('**/hmm.json') }} + restore-keys: | + ${{ runner.os }}-hmm- + ${{ runner.os }}- + - if: ${{ steps.cache-hmm.outputs.cache-hit != 'true' }} + name: hmm install + run: | + haxelib --global run hmm install + shell: bash From 4a4708fe231199f85f16813f4dd009a5fa8d89b6 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 6 Oct 2023 11:42:39 -0400 Subject: [PATCH 10/11] That is the fastest I have ever fixed a bug holy shit. --- source/funkin/play/PlayState.hx | 111 ++------------------------------ source/funkin/util/Constants.hx | 17 ++++- 2 files changed, 20 insertions(+), 108 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 46938215b..8ba5f7a35 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1893,6 +1893,7 @@ class PlayState extends MusicBeatSubState { // Grant the player health. health += Constants.HEALTH_HOLD_BONUS_PER_SECOND * elapsed; + songScore += Std.int(Constants.SCORE_HOLD_BONUS_PER_SECOND * elapsed); } // TODO: Potential penalty for dropping a hold note? @@ -2013,103 +2014,6 @@ class PlayState extends MusicBeatSubState } } - /** - * Handle player inputs. - */ - function keyShit(test:Bool):Void - { - // control arrays, order L D R U - var holdArray:Array = [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT]; - var pressArray:Array = [ - controls.NOTE_LEFT_P, - controls.NOTE_DOWN_P, - controls.NOTE_UP_P, - controls.NOTE_RIGHT_P - ]; - var releaseArray:Array = [ - controls.NOTE_LEFT_R, - controls.NOTE_DOWN_R, - controls.NOTE_UP_R, - controls.NOTE_RIGHT_R - ]; - - // if (pressArray.contains(true)) - // { - // var lol:Array = cast pressArray; - // inputSpitter.push(Std.int(Conductor.songPosition) + ' ' + lol.join(' ')); - // } - - // HOLDS, check for sustain notes - if (holdArray.contains(true) && generatedMusic) - { - /* - activeNotes.forEachAlive(function(daNote:Note) { - if (daNote.isSustainNote && daNote.canBeHit && daNote.mustPress && holdArray[daNote.data.noteData]) goodNoteHit(daNote); - }); - */ - } - - // PRESSES, check for note hits - if (pressArray.contains(true) && generatedMusic) - { - Haptic.vibrate(100, 100); - - if (currentStage != null && currentStage.getBoyfriend() != null) - { - currentStage.getBoyfriend().holdTimer = 0; - } - - var possibleNotes:Array = []; // notes that can be hit - var directionList:Array = []; // directions that can be hit - var dumbNotes:Array = []; // notes to kill later - - for (note in dumbNotes) - { - FlxG.log.add('killing dumb ass note at ' + note.noteData.time); - note.kill(); - // activeNotes.remove(note, true); - note.destroy(); - } - - possibleNotes.sort((a, b) -> Std.int(a.noteData.time - b.noteData.time)); - - if (perfectMode) - { - goodNoteHit(possibleNotes[0], null); - } - else if (possibleNotes.length > 0) - { - for (shit in 0...pressArray.length) - { // if a direction is hit that shouldn't be - if (pressArray[shit] && !directionList.contains(shit)) ghostNoteMiss(shit); - } - for (coolNote in possibleNotes) - { - if (pressArray[coolNote.noteData.getDirection()]) goodNoteHit(coolNote, null); - } - } - else - { - // HNGGG I really want to add an option for ghost tapping - // L + ratio - for (shit in 0...pressArray.length) - if (pressArray[shit]) ghostNoteMiss(shit, false); - } - } - - if (currentStage == null) return; - - for (keyId => isPressed in pressArray) - { - if (playerStrumline == null) continue; - - var dir:NoteDirection = Strumline.DIRECTIONS[keyId]; - - if (isPressed && !playerStrumline.isConfirm(dir)) playerStrumline.playPress(dir); - if (!holdArray[keyId]) playerStrumline.playStatic(dir); - } - } - function goodNoteHit(note:NoteSprite, input:PreciseInputEvent):Void { var event:NoteScriptEvent = new NoteScriptEvent(ScriptEvent.NOTE_HIT, note, Highscore.tallies.combo + 1, true); @@ -2118,19 +2022,16 @@ class PlayState extends MusicBeatSubState // Calling event.cancelEvent() skips all the other logic! Neat! if (event.eventCanceled) return; - if (!note.isHoldNote) - { - Highscore.tallies.combo++; - Highscore.tallies.totalNotesHit++; + Highscore.tallies.combo++; + Highscore.tallies.totalNotesHit++; - if (Highscore.tallies.combo > Highscore.tallies.maxCombo) Highscore.tallies.maxCombo = Highscore.tallies.combo; + if (Highscore.tallies.combo > Highscore.tallies.maxCombo) Highscore.tallies.maxCombo = Highscore.tallies.combo; - popUpScore(note, input); - } + popUpScore(note, input); playerStrumline.hitNote(note); - if (note.holdNoteSprite != null) + if (note.isHoldNote && note.holdNoteSprite != null) { playerStrumline.playNoteHoldCover(note.holdNoteSprite); } diff --git a/source/funkin/util/Constants.hx b/source/funkin/util/Constants.hx index b454ca429..ff6f1dab6 100644 --- a/source/funkin/util/Constants.hx +++ b/source/funkin/util/Constants.hx @@ -288,16 +288,27 @@ class Constants public static final HEALTH_MINE_PENALTY:Float = 15.0 / 100.0 * HEALTH_MAX; // 15.0% /** - * If true, the player will not receive the ghost miss penalty if there are no notes within the hit window. - * This is the thing people have been begging for forever lolol. + * SCORE VALUES */ - public static final GHOST_TAPPING:Bool = false; + // ============================== + + /** + * The amount of score the player gains for every send they hold a hold note. + * A fraction of this value is granted every frame. + */ + public static final SCORE_HOLD_BONUS_PER_SECOND:Float = 250.0; /** * OTHER */ // ============================== + /** + * If true, the player will not receive the ghost miss penalty if there are no notes within the hit window. + * This is the thing people have been begging for forever lolol. + */ + public static final GHOST_TAPPING:Bool = false; + /** * The separator between an asset library and the asset path. */ From 7a1a2e1ab4413ad48007b64caffe3483262ec7c8 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Sun, 8 Oct 2023 22:09:09 -0400 Subject: [PATCH 11/11] Correct FunkinDropDown capitalization --- .../ui/haxeui/components/{FunkinDropdown.hx => FunkinDropDown.hx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename source/funkin/ui/haxeui/components/{FunkinDropdown.hx => FunkinDropDown.hx} (100%) diff --git a/source/funkin/ui/haxeui/components/FunkinDropdown.hx b/source/funkin/ui/haxeui/components/FunkinDropDown.hx similarity index 100% rename from source/funkin/ui/haxeui/components/FunkinDropdown.hx rename to source/funkin/ui/haxeui/components/FunkinDropDown.hx