From d36bd692d88a70dde867386f29497e012310fce6 Mon Sep 17 00:00:00 2001 From: "Rodney, An Imaginative Person" <59747809+RodneyAnImaginativePerson@users.noreply.github.com> Date: Fri, 31 May 2024 10:46:43 -0400 Subject: [PATCH 01/12] Why? (#289) it makes sense to, ya know- USE VARS FOR THE REASON THEY WERE MADE --- source/funkin/game/GameOverSubstate.hx | 2 +- source/funkin/menus/PauseSubState.hx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/funkin/game/GameOverSubstate.hx b/source/funkin/game/GameOverSubstate.hx index 4868b130..66b37968 100644 --- a/source/funkin/game/GameOverSubstate.hx +++ b/source/funkin/game/GameOverSubstate.hx @@ -108,7 +108,7 @@ class GameOverSubstate extends MusicBeatSubstate if (controls.BACK) { if (PlayState.chartingMode && Charter.undos.unsaved) - PlayState.instance.saveWarn(false); + game.saveWarn(false); else { PlayState.resetSongInfos(); if (Charter.instance != null) Charter.instance.__clearStatics(); diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index edc0cb61..2366990c 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -106,7 +106,7 @@ class PauseSubState extends MusicBeatSubstate pauseScript.call("postCreate"); - PlayState.instance.updateDiscordPresence(); + game.updateDiscordPresence(); } override function update(elapsed:Float) @@ -146,7 +146,7 @@ class PauseSubState extends MusicBeatSubstate close(); case "Restart Song": parentDisabler.reset(); - PlayState.instance.registerSmoothTransition(); + game.registerSmoothTransition(); FlxG.resetState(); case "Change Controls": persistentDraw = false; @@ -157,7 +157,7 @@ class PauseSubState extends MusicBeatSubstate FlxG.switchState(new funkin.editors.charter.Charter(PlayState.SONG.meta.name, PlayState.difficulty, false)); case "Exit to menu": if (PlayState.chartingMode && Charter.undos.unsaved) - PlayState.instance.saveWarn(false); + game.saveWarn(false); else { PlayState.resetSongInfos(); if (Charter.instance != null) Charter.instance.__clearStatics(); From 718efbc5d795024975afa93fa74d2ecaceeb991d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Fri, 31 May 2024 17:13:29 +0200 Subject: [PATCH 02/12] fixing macos --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e6646418..819a3af0 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -7,7 +7,7 @@ jobs: build: name: Mac OS Build permissions: write-all - runs-on: macos-latest + runs-on: macos-13 steps: - name: Pulling the new commit uses: actions/checkout@v2 From 4ad59150b42ebdf00134c4aece71b62f6f857129 Mon Sep 17 00:00:00 2001 From: ~ Care <126361810+usb-port-2@users.noreply.github.com> Date: Fri, 31 May 2024 16:17:59 +0100 Subject: [PATCH 03/12] Fixed typo (#283) --- source/funkin/game/Character.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 8efd1a50..f36088e8 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -158,7 +158,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset // [ true ][ false ][ true ] // [ false ][ true ][ true ] // [ true ][ true ][ false ] - // bros provided evedince :skull: + // bros provided evidence :skull: if (isPlayer != playerOffsets && switchAnims) { // character is flipped From d7b6fbe510edeb832112ab5adc8ab19dfe97d77f Mon Sep 17 00:00:00 2001 From: "Rodney, An Imaginative Person" <59747809+RodneyAnImaginativePerson@users.noreply.github.com> Date: Fri, 31 May 2024 11:18:38 -0400 Subject: [PATCH 04/12] Update EventsData.hx (#286) --- source/funkin/backend/chart/EventsData.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/backend/chart/EventsData.hx b/source/funkin/backend/chart/EventsData.hx index 16551cb7..d443218a 100644 --- a/source/funkin/backend/chart/EventsData.hx +++ b/source/funkin/backend/chart/EventsData.hx @@ -48,7 +48,7 @@ class EventsData { } ], "Alt Animation Toggle" => [{name: "Enable On Sing Poses", type: TBool, defValue: true}, {name: "Enable On Idle", type: TBool, defValue: true}, {name: "Strumline", type: TStrumLine, defValue: 0}], - "Play Animation" => [{name: "Character", type: TStrumLine, defValue: 0}, {name: "Animation", type: TString, defValue: "animation"}], + "Play Animation" => [{name: "Character", type: TStrumLine, defValue: 0}, {name: "Animation", type: TString, defValue: "animation"}, {name: "Is forced?", type: TBool, defValue: true}], ]; public static var eventsList:Array = defaultEventsList.copy(); From 71b7daabbfc742212f2b35d27b5655561504bf3a Mon Sep 17 00:00:00 2001 From: "Rodney, An Imaginative Person" <59747809+RodneyAnImaginativePerson@users.noreply.github.com> Date: Fri, 31 May 2024 11:19:11 -0400 Subject: [PATCH 05/12] Fixed typo. (#270) * Fixed typo. * Update Assets.hx --- source/funkin/game/StrumLine.hx | 4 ++-- source/openfl/utils/Assets.hx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index 68320514..17650a5a 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -30,9 +30,9 @@ class StrumLine extends FlxTypedGroup { */ public var onNoteUpdate:FlxTypedSignalVoid> = new FlxTypedSignalVoid>(); /** - * Signal that triggers whenever a note is being updated. Similar to onNoteUpdate, except strumline specific. + * Signal that triggers whenever a note is being deleted. Similar to onNoteDelete, except strumline specific. * To add a listener, do - * `strumLine.onNoteUpdate.add(function(e:NoteUpdateEvent) {});` + * `strumLine.onNoteDelete.add(function(e:SimpleNoteEvent) {});` */ public var onNoteDelete:FlxTypedSignalVoid> = new FlxTypedSignalVoid>(); /** diff --git a/source/openfl/utils/Assets.hx b/source/openfl/utils/Assets.hx index e08852cd..db92e530 100644 --- a/source/openfl/utils/Assets.hx +++ b/source/openfl/utils/Assets.hx @@ -91,7 +91,7 @@ class Assets @usage var bitmap = new Bitmap (Assets.getBitmapData ("image.png")); @param id The ID or asset path for the bitmap @param useCache (Optional) Whether to allow use of the asset cache (Default: true) - @param useCache Whenever the image should be immediately pushed to GPU. + @param pushToGPU Whenever the image should be immediately pushed to GPU. @return A new BitmapData object **/ public static function getBitmapData(id:String, useCache:Bool = true, pushToGPU:Bool = true):BitmapData From be55696bbefe537f06ad6550b039278ffcbcfb2f Mon Sep 17 00:00:00 2001 From: "Notbeep-,-" <112723428+Itzbeepi77@users.noreply.github.com> Date: Fri, 31 May 2024 22:38:30 +0700 Subject: [PATCH 06/12] Add missing bf anims (#276) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update bf.xml add some missing bf anims * fixed offsets and cleaner bf's xml file --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com> --- assets/data/characters/bf.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/data/characters/bf.xml b/assets/data/characters/bf.xml index 04e2b3c5..245fbffd 100644 --- a/assets/data/characters/bf.xml +++ b/assets/data/characters/bf.xml @@ -11,4 +11,8 @@ - \ No newline at end of file + + + + + From c38039c085ace56ed3dde4378ccf0701e1508e1b Mon Sep 17 00:00:00 2001 From: EstoyAburridowGH <81833766+EstoyAburridowGH@users.noreply.github.com> Date: Fri, 31 May 2024 10:39:57 -0500 Subject: [PATCH 07/12] FunkinParentDisabler: Fix camera not updating its size (#281) --- source/funkin/backend/utils/FunkinParentDisabler.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/funkin/backend/utils/FunkinParentDisabler.hx b/source/funkin/backend/utils/FunkinParentDisabler.hx index 37d96277..f0617f5d 100644 --- a/source/funkin/backend/utils/FunkinParentDisabler.hx +++ b/source/funkin/backend/utils/FunkinParentDisabler.hx @@ -41,7 +41,9 @@ class FunkinParentDisabler extends FlxBasic { } } - public override function update(elapsed:Float) {} + public override function update(elapsed:Float) { + @:privateAccess for(c in __cameras) c.updateFlashSpritePosition(); + } public override function draw() {} public function reset() { From 1ac2e7f53390a9e92aa2a1fea94d147ed50d3694 Mon Sep 17 00:00:00 2001 From: Karim Akra <144803230+KarimAkra@users.noreply.github.com> Date: Fri, 31 May 2024 19:08:23 +0300 Subject: [PATCH 08/12] Made main menu shows the current keybind key for opening mods select menu (#271) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Controls.hx * done * fixin a smol typo --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com> --- source/funkin/backend/system/Controls.hx | 9 +++++++-- source/funkin/menus/MainMenuState.hx | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/funkin/backend/system/Controls.hx b/source/funkin/backend/system/Controls.hx index 9dbae1f1..a09da1c7 100644 --- a/source/funkin/backend/system/Controls.hx +++ b/source/funkin/backend/system/Controls.hx @@ -430,13 +430,18 @@ class Controls extends FlxActionSet return byName[name].check(); } + public function getKeyName(control:Control):String + { + return getDialogueName(getActionFromControl(control)); + } + public function getDialogueName(action:FlxActionDigital):String { var input = action.inputs[0]; return switch input.device { - case KEYBOARD: return '[${(input.inputID : FlxKey)}]'; - case GAMEPAD: return '(${(input.inputID : FlxGamepadInputID)})'; + case KEYBOARD: return '${(input.inputID : FlxKey)}'; + case GAMEPAD: return '${(input.inputID : FlxGamepadInputID)}'; case device: throw 'unhandled device: $device'; } } diff --git a/source/funkin/menus/MainMenuState.hx b/source/funkin/menus/MainMenuState.hx index b17e9db6..31b09402 100644 --- a/source/funkin/menus/MainMenuState.hx +++ b/source/funkin/menus/MainMenuState.hx @@ -74,7 +74,7 @@ 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[TAB] Open Mods menu\n'); + 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); From e6e06038d5db0cad7fc601e46045c41f0b6b82e0 Mon Sep 17 00:00:00 2001 From: idk what a git repo is <138817584+what-is-a-git@users.noreply.github.com> Date: Fri, 31 May 2024 12:19:55 -0400 Subject: [PATCH 09/12] fix alphabet stuff from #284 (#288) * fix the dumb * gotta remove the import oops Fixes #284 --- source/funkin/menus/ui/Alphabet.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/menus/ui/Alphabet.hx b/source/funkin/menus/ui/Alphabet.hx index d4c3db47..48075fa7 100644 --- a/source/funkin/menus/ui/Alphabet.hx +++ b/source/funkin/menus/ui/Alphabet.hx @@ -50,7 +50,7 @@ class Alphabet extends FlxSpriteGroup // TODO: fix this shit refreshing public function refreshAlphabetXML(path:String) { - AlphaCharacter.__alphaPath = path; + AlphaCharacter.__alphaPath = Paths.getAssetsRoot() + path; try { var xml = new Access(Xml.parse(Assets.getText(path)).firstElement()); AlphaCharacter.boldAnims = []; @@ -85,7 +85,7 @@ class Alphabet extends FlxSpriteGroup isBold = bold; var alphabetPath = Paths.xml("alphabet"); - if (alphabetPath != AlphaCharacter.__alphaPath) { + if (Paths.getAssetsRoot() + alphabetPath != AlphaCharacter.__alphaPath) { refreshAlphabetXML(alphabetPath); } #if MOD_SUPPORT else { From b682bcfb0b610ead51dbfe8805080d6b7b4a4ebf Mon Sep 17 00:00:00 2001 From: "Rodney, An Imaginative Person" <59747809+RodneyAnImaginativePerson@users.noreply.github.com> Date: Fri, 31 May 2024 12:53:50 -0400 Subject: [PATCH 10/12] Make No and Alt anim notes also effect miss anims (#285) :P --- assets/data/notes/Alt Anim Note.hx | 3 ++- assets/data/notes/No Anim Note.hx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/data/notes/Alt Anim Note.hx b/assets/data/notes/Alt Anim Note.hx index 08acea42..b44b1398 100644 --- a/assets/data/notes/Alt Anim Note.hx +++ b/assets/data/notes/Alt Anim Note.hx @@ -1 +1,2 @@ -function onNoteHit(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "-alt"; \ No newline at end of file +function onNoteHit(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "-alt"; +function onPlayerMiss(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "-alt"; \ No newline at end of file diff --git a/assets/data/notes/No Anim Note.hx b/assets/data/notes/No Anim Note.hx index 31eb0c63..206d4f96 100644 --- a/assets/data/notes/No Anim Note.hx +++ b/assets/data/notes/No Anim Note.hx @@ -1 +1,2 @@ -function onNoteHit(event) if (event.noteType == "No Anim Note") event.animCancelled = true; \ No newline at end of file +function onNoteHit(event) if (event.noteType == "No Anim Note") event.animCancelled = true; +function onPlayerMiss(event) if (event.noteType == "No Anim Note") event.animCancelled = true; \ No newline at end of file From f259d626cfec591ef04c00429b37df16fb7f9857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Fri, 31 May 2024 19:40:28 +0200 Subject: [PATCH 11/12] better characters' suffix anims --- source/funkin/game/Character.hx | 22 +++++++++++++++++++--- source/funkin/game/PlayState.hx | 4 ++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index f36088e8..f902d39a 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -53,6 +53,8 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset public var shadowFrame:CharacterShadowFrame; public var idleSuffix:String = ""; + public var anims = ["singLEFT", "singDOWN", "singUP", "singRIGHT"]; // Not making these inline so theyre editable through scripts! - Nex + public inline function getCameraPosition() { var midpoint = getMidpoint(); @@ -65,11 +67,25 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset return new FlxPoint(event.x, event.y); } + public inline function getSingAnim(direction:Int, suffix:String = ""):String + { + return anims[direction] + suffix; + } + + /** + * Like `playSingAnim` but checks if the character has the animation with the suffix part, otherwhise tries to play the animation without the suffix part. + */ + public function playSafeSingAnim(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, Force:Bool = true, Reversed:Bool = false, Frame:Int = 0) + { + var event = EventManager.get(DirectionAnimEvent).recycle(getSingAnim(direction, suffix), direction, suffix, Context, Reversed, Frame, Force); + script.call("onPlaySafeSingAnim", [event]); + if (!event.cancelled) + playSingAnim(event.direction, hasAnimation(event.animName) ? event.suffix : "", event.context, event.force, event.reversed, event.frame); + } + public function playSingAnim(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, Force:Bool = true, Reversed:Bool = false, Frame:Int = 0) { - var anims = ["singLEFT", "singDOWN", "singUP", "singRIGHT"]; - - var event = EventManager.get(DirectionAnimEvent).recycle(anims[direction] + suffix, direction, suffix, Context, Reversed, Frame, Force); + var event = EventManager.get(DirectionAnimEvent).recycle(getSingAnim(direction, suffix), direction, suffix, Context, Reversed, Frame, Force); script.call("onPlaySingAnim", [event]); if (!event.cancelled) playAnim(event.animName, event.force, event.context, event.reversed, event.frame); diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index f585e89f..fdbe0444 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1572,7 +1572,7 @@ class PlayState extends MusicBeatState if (char == null) continue; if(event.stunned) char.stunned = true; - char.playSingAnim(directionID, event.animSuffix, MISS, event.forceAnim); + char.playSafeSingAnim(directionID, event.animSuffix, MISS, event.forceAnim); } } @@ -1653,7 +1653,7 @@ class PlayState extends MusicBeatState if (!event.animCancelled) for(char in event.characters) if (char != null) - char.playSingAnim(event.direction, event.animSuffix, SING, event.forceAnim); + char.playSafeSingAnim(event.direction, event.animSuffix, SING, event.forceAnim); if (event.note.__strum != null) { if (!event.strumGlowCancelled) event.note.__strum.press(event.note.strumTime); From 4d2c36e2d42ccb40fed5ec38157163152a3755ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Fri, 31 May 2024 20:38:00 +0200 Subject: [PATCH 12/12] making certain scripts break less --- source/funkin/game/Character.hx | 18 +++++++++--------- source/funkin/game/PlayState.hx | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index f902d39a..69afc69e 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -73,20 +73,20 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset } /** - * Like `playSingAnim` but checks if the character has the animation with the suffix part, otherwhise tries to play the animation without the suffix part. + * Like `playSingAnimUnsafe` but checks if the character has the animation with the suffix part, otherwhise tries to play the animation without the suffix part. */ - public function playSafeSingAnim(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, Force:Bool = true, Reversed:Bool = false, Frame:Int = 0) - { - var event = EventManager.get(DirectionAnimEvent).recycle(getSingAnim(direction, suffix), direction, suffix, Context, Reversed, Frame, Force); - script.call("onPlaySafeSingAnim", [event]); - if (!event.cancelled) - playSingAnim(event.direction, hasAnimation(event.animName) ? event.suffix : "", event.context, event.force, event.reversed, event.frame); - } - public function playSingAnim(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, Force:Bool = true, Reversed:Bool = false, Frame:Int = 0) { var event = EventManager.get(DirectionAnimEvent).recycle(getSingAnim(direction, suffix), direction, suffix, Context, Reversed, Frame, Force); script.call("onPlaySingAnim", [event]); + if (!event.cancelled) + playSingAnimUnsafe(event.direction, hasAnimation(event.animName) ? event.suffix : "", event.context, event.force, event.reversed, event.frame); + } + + public function playSingAnimUnsafe(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, Force:Bool = true, Reversed:Bool = false, Frame:Int = 0) + { + var event = EventManager.get(DirectionAnimEvent).recycle(getSingAnim(direction, suffix), direction, suffix, Context, Reversed, Frame, Force); + script.call("onPlaySingAnimUnsafe", [event]); if (!event.cancelled) playAnim(event.animName, event.force, event.context, event.reversed, event.frame); } diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index fdbe0444..f585e89f 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1572,7 +1572,7 @@ class PlayState extends MusicBeatState if (char == null) continue; if(event.stunned) char.stunned = true; - char.playSafeSingAnim(directionID, event.animSuffix, MISS, event.forceAnim); + char.playSingAnim(directionID, event.animSuffix, MISS, event.forceAnim); } } @@ -1653,7 +1653,7 @@ class PlayState extends MusicBeatState if (!event.animCancelled) for(char in event.characters) if (char != null) - char.playSafeSingAnim(event.direction, event.animSuffix, SING, event.forceAnim); + char.playSingAnim(event.direction, event.animSuffix, SING, event.forceAnim); if (event.note.__strum != null) { if (!event.strumGlowCancelled) event.note.__strum.press(event.note.strumTime);