From 401e012204862233b32ed6c772af80f2c56ec7bc Mon Sep 17 00:00:00 2001 From: Joalor64 Date: Sun, 2 Jun 2024 16:35:06 -0400 Subject: [PATCH] jambalaya --- source/meta/data/scripts/FunkinLua.hx | 4 +- source/meta/state/CreditsState.hx | 318 +++--------------- source/meta/state/PlayState.hx | 16 +- source/meta/state/editors/ChartingState.hx | 18 +- .../meta/substate/GameplayChangersSubstate.hx | 2 +- source/objects/Character.hx | 5 +- 6 files changed, 68 insertions(+), 295 deletions(-) diff --git a/source/meta/data/scripts/FunkinLua.hx b/source/meta/data/scripts/FunkinLua.hx index 974ca80c..b2f1731b 100644 --- a/source/meta/data/scripts/FunkinLua.hx +++ b/source/meta/data/scripts/FunkinLua.hx @@ -159,7 +159,7 @@ class FunkinLua { // Gameplay settings set('healthGainMult', PlayState.instance.healthGain); set('healthLossMult', PlayState.instance.healthLoss); - set('playbackRate', PlayState.instance.playbackRate); + #if FLX_PITCH set('playbackRate', PlayState.instance.playbackRate); #end set('instakillOnMiss', PlayState.instance.instakillOnMiss); set('botPlay', PlayState.instance.cpuControlled); set('practice', PlayState.instance.practiceMode); @@ -2299,6 +2299,7 @@ class FunkinLua { } }); + #if FLX_PITCH Lua_helper.add_callback(lua, "getSoundPitch", function(tag:String) { if(tag != null && tag.length > 0 && PlayState.instance.modchartSounds.exists(tag)) { return PlayState.instance.modchartSounds.get(tag).pitch; @@ -2316,6 +2317,7 @@ class FunkinLua { } } }); + #end Lua_helper.add_callback(lua, "debugPrint", function(text1:Dynamic = '', text2:Dynamic = '', text3:Dynamic = '', text4:Dynamic = '', text5:Dynamic = '') { for (i in [text1, text2, text3, text4, text5]) diff --git a/source/meta/state/CreditsState.hx b/source/meta/state/CreditsState.hx index 1cee28e6..ad65977f 100644 --- a/source/meta/state/CreditsState.hx +++ b/source/meta/state/CreditsState.hx @@ -52,265 +52,48 @@ class CreditsState extends MusicBeatState keoikiStr = (FlxG.random.bool(30)) ? 'keoiki2' : 'keoiki'; var pisspoop:Array> = [ - /** - * Name - * Icon name - * Description - * Link - * BG Color - * Sound - **/ + // name, icon, description, link, color, sound ['Joalor64 Engine Creators'], - [ - 'Joalor64 YT', - 'joalor', - 'Project Leader\nMain Programmer\n"I do things"', - 'https://www.youtube.com/channel/UC4tRMRL_iAHX5n1qQpHibfg', - '00FFF6', - 'noweyyy' - ], - [ - 'Moxie', - 'meme', - 'Additional Programmer\n"love denpa engine"', - 'https://github.com/moxie-coder', - 'FFEDD9', - 'omori' // funni sound goes here if you want - ], - [ - 'FoxLOID', - 'fox', - 'Epic New Logo\n"this is a quote"', - 'https://github.com/FoxLOID', - '00A7D4', - '' // if you want, a funny sound effect can go here - ], - [ - 'Bot 404', - 'bot', - 'Tiny little helper, Drew his own icon\n"expected more"', - 'https://www.youtube.com/channel/UC9ntkZ4Nz3AVKrAnderJnOg', - 'FF0040', - 'slipperyahhfloor' - ], + ['Joalor64', 'joalor', 'Project Leader\nMain Programmer\n"I do things"', 'https://www.youtube.com/channel/UC4tRMRL_iAHX5n1qQpHibfg', '00FFF6', 'noweyyy'], + ['Moxie', 'meme', 'Additional Programmer\n"love denpa engine"', 'https://github.com/moxie-coder', 'FFEDD9', 'omori'], + ['FoxLOID', fox', 'Epic New Logo\n"this is a quote"', 'https://github.com/FoxLOID', '00A7D4', ''], + ['Bot 404', 'bot', 'Tiny little helper, Drew his own icon\n"expected more"', 'https://www.youtube.com/channel/UC9ntkZ4Nz3AVKrAnderJnOg', 'FF0040', 'slipperyahhfloor'], [''], ['Special Thanks'], - [ - 'crowplexus', - 'crowplexus', - 'Customizable Main Menu with .JSON, Old Latin Support\nCredits Sounds\nNew Crash Handler\n"just happy to be here!"', - 'https://github.com/crowplexus', - 'a1a1a1', - 'Ghost' - ], - [ - 'TahirKarabekiroglu', - 'tahir', - 'SScript\nFunkin Cocoa Code\nSoftcoded Achievements, Replay System\n"Banger PR"', - 'https://github.com/TahirKarabekiroglu', - 'A04397', - '' - ], - [ - 'steve-studios', - 'mag', - 'In-Game Mod Downloader\n"why bro keep changing his user"', - 'https://github.com/steve-studios', - '0000FF', - 'squeak' - ], - [ - 'TheZoroForce240', - 'zoro', - 'Modcharting Tools Haxelib\n"Not alot to say about this guy"', - 'https://github.com/TheZoroForce240', - 'FFD900', - 'goofyahhphone' - ], - [ - 'MAJigsaw77', - 'jigsaw', - 'ToastCore\n"Just a guy"', - 'https://github.com/MAJigsaw77', - '444444', - '' - ], - [ - 'KookerFoxYT', - 'kooker', - 'Custom Options\n"fox"', - 'https://twitter.com/kookerfoxyt', - '00B0B4', // it spelled bob lmao - '' - ], - [ - 'Endergreen12', - 'none', - 'Custom Gameplay Changers\n"He did a thing"', - 'https://github.com/Endergreen12', - '00C834', - '' - ], - [ - 'Verwex', - 'verwex', - 'Micd Up Paths System\n"hell"', - 'https://github.com/Verwex', - '8FFFFF', - '' - ], - [ - 'ActualMandM', - 'none', - 'RGB Note Coloring System\n"this is a quote"', - 'https://linktr.ee/ActualMandM', - '9C5D88', - '' - ], - [ - 'You', - 'face', - 'For playing :)\n"No problem! -You"', - 'https://joalor64.itch.io/', - '7E00FF', - 'stolethisfromGamerEnginelol' - ], + ['crowplexus', 'crowplexus', 'Customizable Main Menu with .JSON, Old Latin Support\nCredits Sounds\nNew Crash Handler\n"just happy to be here!"', 'https://github.com/crowplexus', 'a1a1a1', 'Ghost'], + ['TahirKarabekiroglu', 'tahir', 'SScript\nFunkin Cocoa Code\nSoftcoded Achievements, Replay System', 'https://github.com/TahirKarabekiroglu', 'A04397', ''], + ['steve-studios', 'mag', 'In-Game Mod Downloader', 'https://github.com/steve-studios', '0000FF', 'squeak'], + ['TheZoroForce240', 'zoro', 'Modcharting Tools Haxelib', 'https://github.com/TheZoroForce240', 'FFD900', 'goofyahhphone'], + ['MAJigsaw77', 'jigsaw', 'ToastCore\n"Just a guy"', 'https://github.com/MAJigsaw77', '444444', ''], + ['KookerFoxYT', 'kooker', 'Custom Options\n"fox"', 'https://twitter.com/kookerfoxyt', '00B0B4', ''], + ['Endergreen12', 'none', 'Custom Gameplay Changers', 'https://github.com/Endergreen12', '00C834', ''], + ['Verwex', 'verwex', 'Micd Up Paths System\n"hell"', 'https://github.com/Verwex', '8FFFFF', ''], + ['ActualMandM', 'none', 'RGB Note Coloring System', 'https://linktr.ee/ActualMandM', '9C5D88', ''], + ['You', 'face', 'For playing :)', 'https://joalor64.itch.io/', '7E00FF', 'stolethisfromGamerEnginelol'], [''], ['Psych Engine Team'], - [ - 'ShadowMario', - 'shadowmario', - 'Main Programmer of Psych Engine', - 'https://twitter.com/Shadow_Mario_', - '444444', - 'JingleShadow' - ], - [ - 'Riveren', - 'riveren', - 'Main Artist/Animator of Psych Engine', - 'https://twitter.com/riverennn', - '14967B', - 'JingleRiver' - ], + ['ShadowMario', 'shadowmario', 'Main Programmer of Psych Engine', 'https://twitter.com/Shadow_Mario_', '444444', 'JingleShadow'], + ['Riveren', 'riveren', 'Main Artist/Animator of Psych Engine', 'https://twitter.com/riverennn', '14967B', 'JingleRiver'], [''], ['Former Engine Members'], - [ - 'bbpanzu', - 'bb', - 'Ex-Programmer of Psych Engine', - 'https://twitter.com/bbsub3', - '3E813A', - 'JingleBB' - ], - [ - 'Yoshubs', - 'none', - 'Ex-Programmer of Psych Engine', - 'https://gamebanana.com/members/1908070', - '888888', - '' - ], + ['bbpanzu', 'bb', 'Ex-Programmer of Psych Engine', 'https://twitter.com/bbsub3', '3E813A', 'JingleBB'], + ['Yoshubs', 'none', 'Ex-Programmer of Psych Engine', 'https://gamebanana.com/members/1908070', '888888', ''], [''], ['Engine Contributors'], - [ - 'iFlicky', - 'flicky', - 'Composer of Psync and Tea Time\nMade the Dialogue Sounds', - 'https://twitter.com/flicky_i', - '9E29CF', - '' - ], - [ - 'gedehari', - 'sqirra', - 'Old Crash Handler and Base code for\nChart Editor\'s Waveform', - 'https://twitter.com/gedehari', - 'E1843A', - '' - ], - [ - 'EliteMasterEric', - 'mastereric', - 'Runtime Shaders support', - 'https://twitter.com/EliteMasterEric', - 'FFBD40', - '' - ], - [ - 'PolybiusProxy', - 'proxy', - 'Creator of hxCodec', - 'https://twitter.com/polybiusproxy', - 'DCD294', - '' - ], - [ - 'KadeDev', - 'kade', - 'Fixed Chart Editor and other PRs\nExtension WebM Fork', - 'https://twitter.com/kade0912', - '64A250', - '' - ], - [ - 'Keoiki', - keoikiStr, - 'Note Splash Animations\nNew Latin Support', - 'https://twitter.com/Keoiki_', - 'D2D2D2', - '' - ], - [ - 'Nebula the Zorua', - 'nebula', - 'LUA JIT Fork and some Lua reworks', - 'https://twitter.com/Nebula_Zorua', - '7D40B2', - '' - ], - [ - 'Smokey', - 'smokey', - 'Sprite Atlas Support', - 'https://twitter.com/Smokey_5_', - '483D92', - '' - ], + ['iFlicky', 'flicky', 'Composer of Psync and Tea Time\nMade the Dialogue Sounds', 'https://twitter.com/flicky_i', '9E29CF', ''], + ['gedehari', 'sqirra', 'Old Crash Handler and Base code for\nChart Editor\'s Waveform', 'https://twitter.com/gedehari', 'E1843A', ''], + ['EliteMasterEric', 'mastereric', 'Runtime Shaders support', 'https://twitter.com/EliteMasterEric', 'FFBD40', ''], + ['PolybiusProxy', 'proxy', 'Creator of hxCodec', 'https://twitter.com/polybiusproxy', 'DCD294', ''], + ['KadeDev', 'kade', 'Fixed Chart Editor and other PRs\nExtension WebM Fork', 'https://twitter.com/kade0912', '64A250', ''], + ['Keoiki', keoikiStr, 'Note Splash Animations\nNew Latin Support', 'https://twitter.com/Keoiki_', 'D2D2D2', ''], + ['Nebula the Zorua', 'nebula', 'LUA JIT Fork and some Lua reworks', 'https://twitter.com/Nebula_Zorua', '7D40B2', ''], + ['Smokey', 'smokey', 'Sprite Atlas Support', 'https://twitter.com/Smokey_5_', '483D92', ''], [''], ["The Funkin' Crew Inc"], - [ - 'ninjamuffin99', - 'ninjamuffin99', - "Programmer/Creator of Friday Night Funkin'", - 'https://twitter.com/ninja_muffin99', - 'CF2D2D', - '' - ], - [ - 'PhantomArcade', - 'phantomarcade', - "Animator of Friday Night Funkin'", - 'https://twitter.com/PhantomArcade3K', - 'FADC45', - '' - ], - [ - 'evilsk8r', - 'evilsk8r', - "Artist of Friday Night Funkin'", - 'https://twitter.com/evilsk8r', - '5ABD4B', - '' - ], - [ - 'kawaisprite', - 'kawaisprite', - "Composer of Friday Night Funkin'", - 'https://twitter.com/kawaisprite', - '378FC7', - '' - ] + ['ninjamuffin99', 'ninjamuffin99', "Programmer/Creator of Friday Night Funkin'", 'https://twitter.com/ninja_muffin99', 'CF2D2D', ''], + ['PhantomArcade', 'phantomarcade', "Animator of Friday Night Funkin'", 'https://twitter.com/PhantomArcade3K', 'FADC45', ''], + ['evilsk8r', 'evilsk8r', "Artist of Friday Night Funkin'", 'https://twitter.com/evilsk8r', '5ABD4B', ''], + ['kawaisprite', 'kawaisprite', "Composer of Friday Night Funkin'", 'https://twitter.com/kawaisprite', '378FC7', ''] ]; for (i in pisspoop) @@ -318,12 +101,13 @@ class CreditsState extends MusicBeatState for (i in 0...creditsStuff.length) { - var isSelectable:Bool = !unselectableCheck(i); - var optionText:Alphabet = new Alphabet(FlxG.width / 2, 300, creditsStuff[i][0], !isSelectable); + var isSelectable:Bool = !(creditsStuff[i].length <= 1); + var optionText:Alphabet = new Alphabet(0, 70 * i, creditsStuff[i][0], !isSelectable); optionText.isMenuItem = true; - optionText.targetY = i; - optionText.changeX = false; + optionText.screenCenter(X); optionText.snapToPosition(); + if (isSelectable) + optionText.x -= 70; grpOptions.add(optionText); if (isSelectable) @@ -343,8 +127,6 @@ class CreditsState extends MusicBeatState if (curSelected == -1) curSelected = i; } - else - optionText.alignment = CENTERED; } descBox = new AttachedSprite(); @@ -457,23 +239,6 @@ class CreditsState extends MusicBeatState } } - for (item in grpOptions.members) - { - if (!item.bold) - { - var lerpVal:Float = CoolUtil.boundTo(elapsed * 12, 0, 1); - if (item.targetY == 0) - { - var lastX:Float = item.x; - item.screenCenter(X); - item.x = FlxMath.lerp(lastX, item.x - 70, lerpVal); - } - else - { - item.x = FlxMath.lerp(item.x, 200 + -40 * Math.abs(item.targetY), lerpVal); - } - } - } super.update(elapsed); } @@ -490,7 +255,7 @@ class CreditsState extends MusicBeatState if (curSelected >= creditsStuff.length) curSelected = 0; } - while (unselectableCheck(curSelected)); + while (creditsStuff[curSelected].length <= 1); var newColor:FlxColor = CoolUtil.colorFromString(creditsStuff[curSelected][4]); trace('The BG color is: $newColor'); @@ -518,7 +283,7 @@ class CreditsState extends MusicBeatState item.targetY = bullShit - curSelected; bullShit++; - if (!unselectableCheck(bullShit - 1)) + if (!(creditsStuff[bullShit - 1].length <= 1)) { item.alpha = 0.6; if (item.targetY == 0) @@ -562,9 +327,4 @@ class CreditsState extends MusicBeatState } } #end - - private function unselectableCheck(num:Int):Bool - { - return creditsStuff[num].length <= 1; - } -} +} \ No newline at end of file diff --git a/source/meta/state/PlayState.hx b/source/meta/state/PlayState.hx index 962c135e..f52afbcd 100644 --- a/source/meta/state/PlayState.hx +++ b/source/meta/state/PlayState.hx @@ -1846,6 +1846,7 @@ class PlayState extends MusicBeatState inline function set_playbackRate(value:Float):Float { + #if FLX_PITCH if(generatedMusic) { if(vocals != null) vocals.pitch = value; @@ -1856,7 +1857,10 @@ class PlayState extends MusicBeatState trace('Anim speed: ' + FlxG.timeScale); Conductor.safeZoneOffset = (ClientPrefs.safeFrames / 60) * 1000 * value; setOnLuas('playbackRate', playbackRate); - return value; + #else + playbackRate = 1.0; + #end + return playbackRate; } public function addTextToDebug(text:String, color:FlxColor = FlxColor.WHITE) { @@ -2937,14 +2941,14 @@ class PlayState extends MusicBeatState vocals.pause(); FlxG.sound.music.time = time; - FlxG.sound.music.pitch = playbackRate; + #if FLX_PITCH FlxG.sound.music.pitch = playbackRate; #end FlxG.sound.music.play(); if (!vocalsFinished){ if (Conductor.songPosition <= vocals.length) { vocals.time = time; - vocals.pitch = playbackRate; + #if FLX_PITCH vocals.pitch = playbackRate; #end } vocals.play(); } @@ -3053,7 +3057,7 @@ class PlayState extends MusicBeatState else vocals = new FlxSound(); - vocals.pitch = playbackRate; + #if FLX_PITCH vocals.pitch = playbackRate; #end FlxG.sound.list.add(vocals); FlxG.sound.list.add(new FlxSound().loadEmbedded(Paths.inst(PlayState.SONG.song))); @@ -3482,13 +3486,13 @@ class PlayState extends MusicBeatState vocals.pause(); FlxG.sound.music.play(); - FlxG.sound.music.pitch = playbackRate; + #if FLX_PITCH FlxG.sound.music.pitch = playbackRate; #end Conductor.songPosition = FlxG.sound.music.time; if (Conductor.songPosition <= vocals.length) { vocals.time = Conductor.songPosition; - vocals.pitch = playbackRate; + #if FLX_PITCH vocals.pitch = playbackRate; #end } vocals.play(); } diff --git a/source/meta/state/editors/ChartingState.hx b/source/meta/state/editors/ChartingState.hx index 8f300af1..536f8e10 100644 --- a/source/meta/state/editors/ChartingState.hx +++ b/source/meta/state/editors/ChartingState.hx @@ -370,10 +370,12 @@ class ChartingState extends MusicBeatState "W/S or Mouse Wheel - Change Conductor's strum time \nA/D - Go to the previous/next section \nLeft/Right - Change Snap - \nUp/Down - Change Conductor's Strum Time with Snapping - \nLeft Bracket / Right Bracket - Change Song Playback Rate (SHIFT to go Faster) - \nALT + Left Bracket / Right Bracket - Reset Song Playback Rate - \nHold Shift to move 4x faster + \nUp/Down - Change Conductor's Strum Time with Snapping" + + #if FLX_PITCH + "\nLeft Bracket / Right Bracket - Change Song Playback Rate (SHIFT to go Faster) + \nALT + Left Bracket / Right Bracket - Reset Song Playback Rate" + + #end + "\nHold Shift to move 4x faster \nHold Control and click on an arrow to select it \nZ/X - Zoom in/out \n @@ -428,7 +430,9 @@ class ChartingState extends MusicBeatState var noteSkinInputText:FlxUIInputText; var noteSplashesInputText:FlxUIInputText; var stageDropDown:FlxUIDropDownMenuCustom; + #if FLX_PITCH var sliderRate:FlxUISlider; + #end function addSongUI():Void { UI_songTitle = new FlxUIInputText(10, 10, 70, _song.song, 8); @@ -1331,7 +1335,7 @@ class ChartingState extends MusicBeatState voicesVolume.name = 'voices_volume'; blockPressWhileTypingOnStepper.push(voicesVolume); - #if !html5 + #if FLX_PITCH sliderRate = new FlxUISlider(this, 'playbackSpeed', 120, 120, 0.5, 3, 150, null, 5, FlxColor.WHITE, FlxColor.BLACK); sliderRate.nameLabel.text = 'Playback Rate'; tab_group_chart.add(sliderRate); @@ -1517,7 +1521,7 @@ class ChartingState extends MusicBeatState switch (sender) { case 'playbackSpeed': - playbackSpeed = Std.int(sliderRate.value); + playbackSpeed = #if FLX_PITCH Std.int(sliderRate.value) #else 1.0 #end; } } } @@ -1979,6 +1983,7 @@ class ChartingState extends MusicBeatState strumLineNotes.members[i].alpha = FlxG.sound.music.playing ? 1 : 0.35; } + #if FLX_PITCH // PLAYBACK SPEED CONTROLS // var holdingShift = FlxG.keys.pressed.SHIFT; var holdingLB = FlxG.keys.pressed.LBRACKET; @@ -1992,6 +1997,7 @@ class ChartingState extends MusicBeatState set_playbackSpeed(playbackSpeed += 0.01); if (FlxG.keys.pressed.ALT && (pressedLB || pressedRB || holdingLB || holdingRB)) set_playbackSpeed(1); + #end bpmTxt.text = Std.string(FlxMath.roundDecimal(Conductor.songPosition / 1000, 2)) + " / " + Std.string(FlxMath.roundDecimal(FlxG.sound.music.length / 1000, 2)) + diff --git a/source/meta/substate/GameplayChangersSubstate.hx b/source/meta/substate/GameplayChangersSubstate.hx index 5181a59d..e5515f60 100644 --- a/source/meta/substate/GameplayChangersSubstate.hx +++ b/source/meta/substate/GameplayChangersSubstate.hx @@ -34,7 +34,7 @@ class GameplayChangersSubstate extends MusicBeatSubstate } optionsArray.push(option); - #if !html5 + #if FLX_PITCH var option:GameplayOption = new GameplayOption('Playback Rate', 'songspeed', 'float', 1); option.scrollSpeed = 1; option.minValue = 0.5; diff --git a/source/objects/Character.hx b/source/objects/Character.hx index f438138b..f39a62de 100644 --- a/source/objects/Character.hx +++ b/source/objects/Character.hx @@ -254,7 +254,8 @@ class Character extends FlxSprite { if(heyTimer > 0) { - heyTimer -= elapsed * PlayState.instance.playbackRate; + var rate:Float = (PlayState.instance != null ? PlayState.instance.playbackRate : 1.0); + heyTimer -= elapsed * rate; if(heyTimer <= 0) { if(specialAnim && animation.curAnim.name == 'hey' || animation.curAnim.name == 'cheer') @@ -290,7 +291,7 @@ class Character extends FlxSprite if (animation.curAnim.name.startsWith('sing')) holdTimer += elapsed; - if (holdTimer >= Conductor.stepCrochet * (0.0011 / (FlxG.sound.music != null ? FlxG.sound.music.pitch : 1)) * singDuration) + if (holdTimer >= Conductor.stepCrochet * (0.0011 #if FLX_PITCH / (FlxG.sound.music != null ? FlxG.sound.music.pitch : 1) #end) * singDuration) { dance(); holdTimer = 0;