From dab6a3b5200647dcd6801a0701e78fa95e826b07 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Sun, 19 Jan 2025 22:04:03 +0100 Subject: [PATCH 01/14] Small crash fix --- source/funkin/backend/assets/Paths.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/backend/assets/Paths.hx b/source/funkin/backend/assets/Paths.hx index 39783823..9486aed6 100644 --- a/source/funkin/backend/assets/Paths.hx +++ b/source/funkin/backend/assets/Paths.hx @@ -209,10 +209,10 @@ class Paths * @param SkipAtlasCheck Whenever the atlas check should be skipped. * @return FlxFramesCollection Frames */ - static function loadFrames(path:String, Unique:Bool = false, Key:String = null, SkipAtlasCheck:Bool = false):FlxFramesCollection { + static function loadFrames(path:String, Unique:Bool = false, Key:String = null, SkipAtlasCheck:Bool = false, SkipMultiCheck:Bool = false):FlxFramesCollection { var noExt = Path.withoutExtension(path); - if (Assets.exists('$noExt/1.png')) { + if (!SkipMultiCheck && Assets.exists('$noExt/1.png')) { // MULTIPLE SPRITESHEETS!! var graphic = FlxG.bitmap.add("flixel/images/logo/default.png", false, '$noExt/mult'); @@ -224,7 +224,7 @@ class Paths var cur = 1; var finalFrames = new MultiFramesCollection(graphic); while(Assets.exists('$noExt/$cur.png')) { - var spr = loadFrames('$noExt/$cur.png'); + var spr = loadFrames('$noExt/$cur.png', false, null, false, true); finalFrames.addFrames(spr); cur++; } From 18bd57134284b9df4c47b8b1ddf69fc3740b0e7b Mon Sep 17 00:00:00 2001 From: NyxieFemboy Date: Sun, 19 Jan 2025 16:25:53 -0500 Subject: [PATCH 02/14] Allow countdown sprites to use FunkinSprite features --- source/funkin/game/PlayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 1b5bf86c..e36866cb 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -910,7 +910,7 @@ class PlayState extends MusicBeatState var spr = event.spritePath; if (!Assets.exists(spr)) spr = Paths.image('$spr'); - sprite = new FlxSprite().loadAnimatedGraphic(spr); + sprite = new FunkinSprite().loadAnimatedGraphic(spr); sprite.scrollFactor.set(); sprite.scale.set(event.scale, event.scale); sprite.updateHitbox(); From ec2cae9f810000da09b080454445f0195a649654 Mon Sep 17 00:00:00 2001 From: SevDoesStuff <132237065+NyxieFemboy@users.noreply.github.com> Date: Mon, 20 Jan 2025 13:17:42 -0500 Subject: [PATCH 03/14] character editor Icon color wheel fix (#496) * character Icon color wheel fix * better method lol (thank you lunar) --- source/funkin/editors/character/CharacterInfoScreen.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/funkin/editors/character/CharacterInfoScreen.hx b/source/funkin/editors/character/CharacterInfoScreen.hx index 4f44dc81..1d7f313b 100644 --- a/source/funkin/editors/character/CharacterInfoScreen.hx +++ b/source/funkin/editors/character/CharacterInfoScreen.hx @@ -76,6 +76,9 @@ class CharacterInfoScreen extends UISubstateWindow { add(iconColorWheel); addLabelOn(iconColorWheel, "Icon Color"); + if (character.iconColor != null) + iconColorWheel.colorChanged = true; + add(title = new UIText(spriteTextBox.x, spriteTextBox.y + 10 + 46 + 84, 0, "Character Data", 28)); positionXStepper = new UINumericStepper(title.x, title.y + title.height + 36, character.globalOffset.x, 0.001, 2, null, null, 84); From 94db415e349c58446365e57cf854f2eebcd13646 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Thu, 23 Jan 2025 02:49:17 +0100 Subject: [PATCH 04/14] Fix issues with FlxRandom.shuffle/getObject + more --- project.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project.xml b/project.xml index 6f01bc10..f8858801 100644 --- a/project.xml +++ b/project.xml @@ -150,6 +150,9 @@ + + + From d802c429e198a7af151e8141d3c8b3ec7849ea34 Mon Sep 17 00:00:00 2001 From: Furo Date: Sat, 25 Jan 2025 15:50:00 +0100 Subject: [PATCH 05/14] TreeMenu Fix Constructor Arguments and Fallback "main" --- source/funkin/options/TreeMenu.hx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/funkin/options/TreeMenu.hx b/source/funkin/options/TreeMenu.hx index b0651fd2..3e05a4af 100644 --- a/source/funkin/options/TreeMenu.hx +++ b/source/funkin/options/TreeMenu.hx @@ -7,6 +7,7 @@ import flixel.tweens.FlxTween; import funkin.menus.MainMenuState; import flixel.util.typeLimit.OneOfTwo; import funkin.options.type.OptionType; +import funkin.options.type.TextOption; import funkin.backend.system.framerate.Framerate; class TreeMenu extends UIState { @@ -18,13 +19,13 @@ class TreeMenu extends UIState { public static var lastState:Class = null; // Static for fixing the softlock bugs when resetting the state - Nex - public function new() { + public function new(scriptsAllowed:Bool = true, ?scriptName:String) { if(lastState == null) lastState = Type.getClass(FlxG.state); - super(); + super(scriptsAllowed, scriptName); } public override function createPost() { - if (main == null) throw "\"main\" variable has not been set in extended class!"; + if (main == null) main = new OptionsScreen("Fallback Treemenu", "Please set the \"main\" variable in your extended class before createPost", [new TextOption("Oops! No Options", "This doesn't look like it was supposed to happen...", () -> FlxG.resetState() ) ]); FlxG.camera.scroll.set(-FlxG.width, 0); @@ -119,4 +120,4 @@ typedef OptionCategory = { typedef OptionTypeDef = { var type:Class; var args:Array; -} \ No newline at end of file +} From d0254eec447eaf2e9513e6b49368273b4ec93a9a Mon Sep 17 00:00:00 2001 From: TheZoroForce240 <86524550+TheZoroForce240@users.noreply.github.com> Date: Sun, 26 Jan 2025 21:02:44 +0000 Subject: [PATCH 06/14] fix infinite loop that could happen when deleting a strumline (#535) --- source/funkin/editors/charter/Charter.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 4ec2f299..daf7aad2 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -1158,7 +1158,7 @@ class Charter extends UIState { if (note.strumLineID == strumLineID) selection.remove(note); else i++; - } + } else i++; } } #end From 59b0c2ddeec521250c93fb65914851a0f949097b Mon Sep 17 00:00:00 2001 From: Frakits <90983918+Frakits@users.noreply.github.com> Date: Fri, 31 Jan 2025 16:31:48 +0200 Subject: [PATCH 07/14] nape integration support... --- project.xml | 4 ++++ source/funkin/backend/system/macros/Macros.hx | 1 + 2 files changed, 5 insertions(+) diff --git a/project.xml b/project.xml index f8858801..e5edd833 100644 --- a/project.xml +++ b/project.xml @@ -139,6 +139,9 @@ + + +
@@ -178,6 +181,7 @@ + diff --git a/source/funkin/backend/system/macros/Macros.hx b/source/funkin/backend/system/macros/Macros.hx index 9183e4a4..bb0b4972 100644 --- a/source/funkin/backend/system/macros/Macros.hx +++ b/source/funkin/backend/system/macros/Macros.hx @@ -21,6 +21,7 @@ class Macros { // OTHER LIBRARIES & STUFF #if THREE_D_SUPPORT "away3d", "flx3d", #end #if VIDEO_CUTSCENES "hxvlc.flixel", "hxvlc.openfl", #end + #if NAPE_ENABLED "nape", "flixel.addons.nape", #end // BASE HAXE "DateTools", "EReg", "Lambda", "StringBuf", "haxe.crypto", "haxe.display", "haxe.exceptions", "haxe.extern", "scripting" ]) From 52fca3c126a2fa29a0be06fa98196fe0197eccc5 Mon Sep 17 00:00:00 2001 From: Frakits <90983918+Frakits@users.noreply.github.com> Date: Fri, 31 Jan 2025 16:36:47 +0200 Subject: [PATCH 08/14] i forgot... --- libs.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/libs.xml b/libs.xml index f932da09..570b451c 100644 --- a/libs.xml +++ b/libs.xml @@ -19,4 +19,5 @@ + From 3d2cbc405930a9dfc538895fcb26ab186ccedf3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:10:05 +0100 Subject: [PATCH 09/14] crash fix and better accuracy format on acc text --- source/funkin/game/PlayState.hx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index e36866cb..09cf56ce 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1235,8 +1235,15 @@ class PlayState extends MusicBeatState accFormat.format.color = curRating.color; accuracyTxt.text = 'Accuracy:${accuracy < 0 ? "-%" : '${CoolUtil.quantize(accuracy * 100, 100)}%'} - ${curRating.rating}'; - accuracyTxt._formatRanges[0].range.start = accuracyTxt.text.length - curRating.rating.length; - accuracyTxt._formatRanges[0].range.end = accuracyTxt.text.length; + var formatIndex:Int = -1; + for (i => frmtRange in accuracyTxt._formatRanges) if (frmtRange.format == accFormat) { + formatIndex = i; + break; + } + if (formatIndex > -1) { + accuracyTxt._formatRanges[formatIndex].range.start = accuracyTxt.text.length - curRating.rating.length; + accuracyTxt._formatRanges[formatIndex].range.end = accuracyTxt.text.length; + } } } From 93c6542a955185705e1b36fa173fc6f237b1151c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:33:48 +0100 Subject: [PATCH 10/14] nvm this is more performant why did i have to separate it --- source/funkin/game/PlayState.hx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 09cf56ce..1e56aad1 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1235,15 +1235,11 @@ class PlayState extends MusicBeatState accFormat.format.color = curRating.color; accuracyTxt.text = 'Accuracy:${accuracy < 0 ? "-%" : '${CoolUtil.quantize(accuracy * 100, 100)}%'} - ${curRating.rating}'; - var formatIndex:Int = -1; for (i => frmtRange in accuracyTxt._formatRanges) if (frmtRange.format == accFormat) { - formatIndex = i; + accuracyTxt._formatRanges[i].range.start = accuracyTxt.text.length - curRating.rating.length; + accuracyTxt._formatRanges[i].range.end = accuracyTxt.text.length; break; } - if (formatIndex > -1) { - accuracyTxt._formatRanges[formatIndex].range.start = accuracyTxt.text.length - curRating.rating.length; - accuracyTxt._formatRanges[formatIndex].range.end = accuracyTxt.text.length; - } } } From 8196103b30eee6e5c7ebc0012f198654fc3b2cd7 Mon Sep 17 00:00:00 2001 From: charlesisfeline <62410083+charlesisfeline@users.noreply.github.com> Date: Sun, 9 Feb 2025 15:44:30 -0500 Subject: [PATCH 11/14] Make the level info text in `PauseSubState` accessible to scripts (#549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update PauseSubState.hx * making them funkin text and organizing imports --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com> --- source/funkin/menus/PauseSubState.hx | 34 +++++++++++++++------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index ecf2fa7d..641b72b1 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -1,20 +1,20 @@ package funkin.menus; -import funkin.editors.charter.Charter; -import funkin.backend.scripting.events.MenuChangeEvent; -import funkin.options.OptionsMenu; -import funkin.backend.scripting.events.PauseCreationEvent; -import funkin.backend.scripting.events.NameEvent; -import funkin.backend.scripting.Script; import flixel.sound.FlxSound; -import flixel.text.FlxText; import flixel.tweens.FlxTween; import flixel.util.FlxColor; -import funkin.options.keybinds.KeybindsOptions; -import funkin.menus.StoryMenuState; +import funkin.backend.FunkinText; +import funkin.backend.scripting.Script; +import funkin.backend.scripting.events.MenuChangeEvent; +import funkin.backend.scripting.events.NameEvent; +import funkin.backend.scripting.events.PauseCreationEvent; import funkin.backend.system.Conductor; import funkin.backend.utils.FunkinParentDisabler; +import funkin.editors.charter.Charter; +import funkin.menus.StoryMenuState; +import funkin.options.OptionsMenu; import funkin.options.TreeMenu; +import funkin.options.keybinds.KeybindsOptions; class PauseSubState extends MusicBeatSubstate { @@ -22,6 +22,11 @@ class PauseSubState extends MusicBeatSubstate var grpMenuShit:FlxTypedGroup; + var levelInfo:FunkinText; + var levelDifficulty:FunkinText; + var deathCounter:FunkinText; + var multiplayerText:FunkinText; + var menuItems:Array = ['Resume', 'Restart Song', 'Change Controls', 'Change Options', 'Exit to menu', "Exit to charter"]; var curSelected:Int = 0; @@ -56,7 +61,6 @@ class PauseSubState extends MusicBeatSubstate menuItems = event.options; - pauseMusic = FlxG.sound.load(Paths.music(event.music), 0, true); pauseMusic.persist = false; pauseMusic.group = FlxG.sound.defaultMusicGroup; @@ -71,15 +75,13 @@ class PauseSubState extends MusicBeatSubstate bg.scrollFactor.set(); add(bg); - var levelInfo:FlxText = new FlxText(20, 15, 0, PlayState.SONG.meta.displayName, 32); - var levelDifficulty:FlxText = new FlxText(20, 15, 0, PlayState.difficulty.toUpperCase(), 32); - var deathCounter:FlxText = new FlxText(20, 15, 0, "Blue balled: " + PlayState.deathCounter, 32); - var multiplayerText:FlxText = new FlxText(20, 15, 0, PlayState.opponentMode ? 'OPPONENT MODE' : (PlayState.coopMode ? 'CO-OP MODE' : ''), 32); + levelInfo = new FunkinText(20, 15, 0, PlayState.SONG.meta.displayName, 32, false); + levelDifficulty = new FunkinText(20, 15, 0, PlayState.difficulty.toUpperCase(), 32, false); + deathCounter = new FunkinText(20, 15, 0, "Blue balled: " + PlayState.deathCounter, 32, false); + multiplayerText = new FunkinText(20, 15, 0, PlayState.opponentMode ? 'OPPONENT MODE' : (PlayState.coopMode ? 'CO-OP MODE' : ''), 32, false); for(k=>label in [levelInfo, levelDifficulty, deathCounter, multiplayerText]) { label.scrollFactor.set(); - label.setFormat(Paths.font('vcr.ttf'), 32); - label.updateHitbox(); label.alpha = 0; label.x = FlxG.width - (label.width + 20); label.y = 15 + (32 * k); From 28396e28bbf71b9f289a8bd7aef3cc5afb6ef6b8 Mon Sep 17 00:00:00 2001 From: cyn Date: Sat, 15 Feb 2025 07:44:19 -0800 Subject: [PATCH 12/14] openalsoft audio fix (#552) Co-authored-by: Smokey <78874128+Smokey555@users.noreply.github.com> Co-authored-by: Cobalt Bar <79053181+CobaltBar@users.noreply.github.com> --- alsoft.txt | 14 +++++++++ project.xml | 6 ++++ .../backend/system/modules/ALSoftConfig.hx | 31 +++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 alsoft.txt create mode 100644 source/funkin/backend/system/modules/ALSoftConfig.hx diff --git a/alsoft.txt b/alsoft.txt new file mode 100644 index 00000000..2f928c99 --- /dev/null +++ b/alsoft.txt @@ -0,0 +1,14 @@ +[general] +sample-type=float32 +stereo-mode=speakers +stereo-encoding=panpot +hrtf=false +cf_level=0 +resampler=fast_bsinc24 +front-stablizer=false +output-limiter=false +volume-adjust=0 +[decoder] +hq-mode=false +distance-comp=false +nfc=false \ No newline at end of file diff --git a/project.xml b/project.xml index e5edd833..382ed9f6 100644 --- a/project.xml +++ b/project.xml @@ -67,6 +67,12 @@ + +
+ + +
+ diff --git a/source/funkin/backend/system/modules/ALSoftConfig.hx b/source/funkin/backend/system/modules/ALSoftConfig.hx new file mode 100644 index 00000000..0b1b57a0 --- /dev/null +++ b/source/funkin/backend/system/modules/ALSoftConfig.hx @@ -0,0 +1,31 @@ +package funkin.backend.system.modules; + +import haxe.io.Path; + +/* + * A class that simply points OpenALSoft to a custom configuration file when + * the game starts up. + * + * The config overrides a few global OpenALSoft settings with the aim of + * improving audio quality on desktop targets. + */ +@:keepInit class ALSoftConfig +{ + #if desktop + static function __init__():Void + { + var origin:String = #if hl Sys.getCwd() #else Sys.programPath() #end; + + var configPath:String = Path.directory(Path.withoutExtension(origin)); + #if windows + configPath += "/plugins/alsoft.ini"; + #elseif mac + configPath = Path.directory(configPath) + "/Resources/plugins/alsoft.conf"; + #else + configPath += "/plugins/alsoft.conf"; + #end + + Sys.putEnv("ALSOFT_CONF", configPath); + } + #end +} \ No newline at end of file From 8f4394b6ad0111ac9e64f2dbfae6b47cadf6418d Mon Sep 17 00:00:00 2001 From: NyxieFemboy <132237065+NyxieFemboy@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:41:02 -0500 Subject: [PATCH 13/14] made alt notes actually play alt miss animations --- assets/data/notes/Alt Anim Note.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/data/notes/Alt Anim Note.hx b/assets/data/notes/Alt Anim Note.hx index b44b1398..ebc3e361 100644 --- a/assets/data/notes/Alt Anim Note.hx +++ b/assets/data/notes/Alt Anim Note.hx @@ -1,2 +1,2 @@ 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 +function onPlayerMiss(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "miss-alt"; \ No newline at end of file From 2474575eeabd8f4a09926a5eace033d7cf9292cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sat, 22 Feb 2025 19:47:45 +0100 Subject: [PATCH 14/14] strums are now easily changeable --- source/funkin/game/StrumLine.hx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index b5880acc..1b0780dd 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -299,8 +299,10 @@ class StrumLine extends FlxTypedGroup { * Creates a strum and returns the created strum (needs to be added manually). * @param i Index of the strum * @param animPrefix (Optional) Animation prefix (`left` = `arrowLEFT`, `left press`, `left confirm`). + * @param spritePath (Optional) The sprite's graphic path if you don't want the default one. + * @param playIntroAnimation (Optional) Whenever the intro animation should be played, by default might be `true` under certain conditions. */ - public function createStrum(i:Int, ?animPrefix:String) { + public function createStrum(i:Int, ?animPrefix:String, ?spritePath:String, ?playIntroAnimation:Bool) { if (animPrefix == null) animPrefix = strumAnimPrefix[i % strumAnimPrefix.length]; var babyArrow:Strum = new Strum(startingPos.x + ((Note.swagWidth * strumScale) * i), startingPos.y); @@ -310,7 +312,8 @@ class StrumLine extends FlxTypedGroup { babyArrow.scrollSpeed = data.scrollSpeed; var event = EventManager.get(StrumCreationEvent).recycle(babyArrow, PlayState.instance.strumLines.members.indexOf(this), i, animPrefix); - event.__doAnimation = !MusicBeatState.skipTransIn && (PlayState.instance != null ? PlayState.instance.introLength > 0 : true); + event.__doAnimation = playIntroAnimation == null ? (!MusicBeatState.skipTransIn && (PlayState.instance != null ? PlayState.instance.introLength > 0 : true)) : playIntroAnimation; + if (spritePath != null) event.sprite = spritePath; event = PlayState.instance.scripts.event("onStrumCreation", event); if (!event.cancelled) {