From f1a40b176af458cb89defb0d3f7f750b009bb6d3 Mon Sep 17 00:00:00 2001 From: TheRealJake_12 <84357907+TheRealJake12@users.noreply.github.com> Date: Sat, 23 Nov 2024 22:50:11 -0600 Subject: [PATCH] use hxpkg and fix winter horrorland in storymode --- .github/workflows/linux.yml | 4 +- .github/workflows/mac.yml | 44 +------ .github/workflows/windows.yml | 4 +- .hxpkg | 68 +++++++++++ Update.hx | 46 -------- hmm.json | 90 --------------- setup/easysetup.bat | 58 ---------- setup/easysetup.sh | 19 --- source/kec/states/PlayState.hx | 205 +++++++++++++-------------------- 9 files changed, 156 insertions(+), 382 deletions(-) create mode 100644 .hxpkg delete mode 100644 Update.hx delete mode 100644 hmm.json delete mode 100644 setup/easysetup.bat delete mode 100644 setup/easysetup.sh diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 914ad6fe..b0aa354e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -35,7 +35,9 @@ jobs: cache-build-linux - name: Installing/Updating libraries run: | - haxe -cp ./update -D analyzer-optimize -main Update --interp + haxelib --global install hxpkg + haxelib --global run hxpkg setup + hxpkg install --force - name: Building the game run: | haxelib run lime build linux diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 32c10781..4f96eacb 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -24,48 +24,14 @@ jobs: - name: Installing main libraries run: | export DYLD_LIBRARY_PATH=/Users/runner/hostedtoolcache/neko/2.3.0/x64:/usr/local/lib - haxelib install lime - haxelib install openfl - haxelib install flixel - haxelib install flixel-tools - haxelib install flixel-addons - haxelib install hxcpp-debug-server - haxelib install hxvlc - haxelib install hscript - haxelib install flixel-text-input - - - name: Setting up HaxeFlixel - run: | - export DYLD_LIBRARY_PATH=/Users/runner/hostedtoolcache/neko/2.3.0/x64:/usr/local/lib - haxelib run lime setup - haxelib run lime setup flixel - - - name: Setting up Flixel Tools - run: | - export DYLD_LIBRARY_PATH=/Users/runner/hostedtoolcache/neko/2.3.0/x64:/usr/local/lib - echo "y" | haxelib run flixel-tools setup || echo "Flixel Tools setup failed" - - - + haxelib --global install hxpkg + haxelib --global run hxpkg setup + hxpkg install --force + - name: Verifying Libraries run: | haxelib list - - - name: ENGINELibs1 - run: | - haxelib git polymod https://github.com/swordcube/scriptless-polymod.git - haxelib git tjson https://github.com/EliteMasterEric/TJSON.git - haxelib git hscript-improved https://github.com/FNF-CNE-Devs/hscript-improved.git - haxelib git haxeui-core https://github.com/haxeui/haxeui-core.git --skip-dependencies - - - name: ENGINELibs2 - run: | - haxelib git haxeui-flixel https://github.com/haxeui/haxeui-flixel.git --skip-dependencies - haxelib git linc_luajit https://github.com/nebulazorua/linc_luajit.git - haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc.git - - - + - name: Building the game run: | export DYLD_LIBRARY_PATH=/Users/runner/hostedtoolcache/neko/2.3.0/x64:/usr/local/lib diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0ac39100..19f04d32 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -26,7 +26,9 @@ jobs: cache-build-windows - name: Installing/Updating libraries run: | - haxe -cp ./update -D analyzer-optimize -main Update --interp + haxelib --global install hxpkg + haxelib --global run hxpkg setup + hxpkg install --force shell: cmd - name: Building the game run: | diff --git a/.hxpkg b/.hxpkg new file mode 100644 index 00000000..2a30b5a2 --- /dev/null +++ b/.hxpkg @@ -0,0 +1,68 @@ +[ + { + "profile": "default", + "pkgs": [ + { + "name": "flixel" + }, + { + "name": "openfl" + }, + { + "name": "lime" + }, + { + "name": "flixel-tools" + }, + { + "name": "flixel-addons" + }, + { + "name": "flixel-text-input" + }, + { + "name": "hxcpp-debug-server" + }, + { + "name": "polymod", + "link": "https://github.com/swordcube/scriptless-polymod.git" + }, + { + "name": "hxvlc" + }, + { + "name": "hscript" + }, + { + "name": "hxdiscord_rpc", + "link": "https://github.com/MAJigsaw77/hxdiscord_rpc.git" + }, + { + "name": "haxeui-core", + "link": "https://github.com/haxeui/haxeui-core.git" + }, + { + "name": "haxeui-flixel", + "link": "https://github.com/haxeui/haxeui-flixel.git" + }, + { + "name": "hxcpp" + }, + { + "name": "thx.semver" + }, + { + "name": "thx.core", + "link": "https://github.com/fponticelli/thx.core.git" + }, + { + "name": "linc_luajit", + "link": "https://github.com/superpowers04/linc_luajit" + }, + { + "name": "hscript-improved", + "link": "https://github.com/FNF-CNE-Devs/hscript-improved.git" + } + ] + } +] \ No newline at end of file diff --git a/Update.hx b/Update.hx deleted file mode 100644 index aba7441a..00000000 --- a/Update.hx +++ /dev/null @@ -1,46 +0,0 @@ -import haxe.Json; -import sys.io.File; -import sys.FileSystem; - -class Update { - public static function main() { - // to prevent messing with currently installed libs - if (!FileSystem.exists('.haxelib')) - FileSystem.createDirectory('.haxelib'); - - var json:Array = Json.parse(File.getContent('./hmm.json')).dependencies; - prettyPrint("Preparing installation..."); - for(lib in json) { - // install libs - switch(lib.type) { - case "haxelib": - prettyPrint('Installing "${lib.name}"...'); - Sys.command('haxelib install ${lib.name} ${lib.version != null ? " " + lib.version : " "}'); - case "git": - prettyPrint('Installing "${lib.name}" from git url "${lib.url}"'); - Sys.command('haxelib git ${lib.name} ${lib.url}'); - default: - prettyPrint('Cannot resolve library of type "${lib.type}"'); - } - } - } - - public static function prettyPrint(text:String) { - var header = "══════"; - for(i in 0...text.length) - header += "═"; - Sys.println(""); - Sys.println('╔$header╗'); - Sys.println('║ $text ║'); - Sys.println('╚$header╝'); - } -} - -typedef Library = { - var name:String; - var type:String; - var version:String; - var dir:String; - var ref:String; - var url:String; -} \ No newline at end of file diff --git a/hmm.json b/hmm.json deleted file mode 100644 index d252be78..00000000 --- a/hmm.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "dependencies": [ - { - "name": "flixel", - "type": "haxelib", - "version": null - }, - { - "name": "lime", - "type": "haxelib", - "version": null - }, - { - "name": "openfl", - "type": "haxelib", - "version": "9.3.4" - }, - { - "name": "flixel-tools", - "type": "haxelib", - "version": null - }, - { - "name": "flixel-addons", - "type": "haxelib", - "version": null - }, - { - "name": "hxcpp-debug-server", - "type": "haxelib", - "version": null - }, - { - "name": "polymod", - "type": "git", - "url": "https://github.com/swordcube/scriptless-polymod.git" - }, - { - "name": "flixel-text-input", - "type": "haxelib", - "version": null - }, - { - "name": "linc_luajit", - "type": "git", - "ref": "master", - "url": "https://github.com/superpowers04/linc_luajit" - }, - { - "name": "tjson", - "type": "git", - "ref": "master", - "url": "https://github.com/EliteMasterEric/TJSON.git" - }, - { - "name": "hscript-improved", - "type": "git", - "ref": "master", - "url": "https://github.com/FNF-CNE-Devs/hscript-improved.git" - }, - { - "name": "hxdiscord_rpc", - "type": "git", - "ref": "main", - "url": "https://github.com/MAJigsaw77/hxdiscord_rpc.git" - }, - { - "name": "haxeui-flixel", - "type": "git", - "ref": "master", - "url": "https://github.com/haxeui/haxeui-flixel.git --skip-dependencies" - }, - { - "name": "haxeui-core", - "type": "git", - "ref": "master", - "url": "https://github.com/haxeui/haxeui-core.git --skip-dependencies" - }, - { - "name": "hxvlc", - "type": "haxelib", - "version": null - }, - { - "name": "hscript", - "type": "haxelib", - "version": null - } - ] -} diff --git a/setup/easysetup.bat b/setup/easysetup.bat deleted file mode 100644 index 2b0cca47..00000000 --- a/setup/easysetup.bat +++ /dev/null @@ -1,58 +0,0 @@ -@echo off -title KEC Setup - Start -echo Make sure Haxe 4.3.6 is installed. -echo Press any key to install required libraries. -pause >nul -title KEC Setup - Installing libraries -echo Installing haxelib libraries... -haxelib install lime -haxelib install openfl -haxelib install flixel -haxelib install flixel-tools -haxelib install flixel-addons -haxelib install hxcpp-debug-server -haxelib install hxvlc -haxelib install hscript -haxelib install flixel-text-input -haxelib run lime setup -haxelib run lime setup flixel -haxelib run flixel-tools setup -title KEC Setup - User action required -cls -echo Make sure you have git installed. You can download it here: https://git-scm.com/downloads -echo Press any key to install the git libraries. -pause >nul -title KEC Setup - Installing libraries -haxelib git polymod https://github.com/swordcube/scriptless-polymod.git -haxelib git hscript-improved https://github.com/FNF-CNE-Devs/hscript-improved.git -haxelib git haxeui-core https://github.com/haxeui/haxeui-core.git --skip-dependencies -haxelib git haxeui-flixel https://github.com/haxeui/haxeui-flixel.git --skip-dependencies -haxelib git linc_luajit https://github.com/nebulazorua/linc_luajit.git -haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc.git -cls - -title KEC Setup - User action required -set /p menu="Would you like to install Visual Studio Community and components? (Necessary to compile/ 5.5GB) [Y/N]" - if %menu%==Y goto InstallVSCommunity - if %menu%==y goto InstallVSCommunity - if %menu%==N goto SkipVSCommunity - if %menu%==n goto SkipVSCommunity - cls - - -:SkipVSCommunity -cls -title KEC Setup - Success -echo Setup successful. Press any key to exit. -pause >nul -exit - -cls -gotoInstallVSCommunity - -:InstallVSCommunity -title KEC Setup - Installing Visual Studio Community -curl -# -O https://download.visualstudio.microsoft.com/download/pr/3105fcfe-e771-41d6-9a1c-fc971e7d03a7/8eb13958dc429a6e6f7e0d6704d43a55f18d02a253608351b6bf6723ffdaf24e/vs_Community.exe -vs_Community.exe --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.19041 -p -del vs_Community.exe -goto SkipVSCommunity diff --git a/setup/easysetup.sh b/setup/easysetup.sh deleted file mode 100644 index 4a2e2ee9..00000000 --- a/setup/easysetup.sh +++ /dev/null @@ -1,19 +0,0 @@ -haxelib install lime -haxelib install openfl -haxelib install flixel -haxelib install flixel-tools -haxelib install flixel-addons -haxelib install hxcpp-debug-server -haxelib install hxvlc -haxelib install hscript -haxelib install flixel-text-input -haxelib run lime setup -haxelib run lime setup flixel -haxelib run flixel-tools setup - -haxelib git polymod https://github.com/swordcube/scriptless-polymod.git -haxelib git hscript-improved https://github.com/FNF-CNE-Devs/hscript-improved.git -haxelib git haxeui-core https://github.com/haxeui/haxeui-core.git --skip-dependencies -haxelib git haxeui-flixel https://github.com/haxeui/haxeui-flixel.git --skip-dependencies -haxelib git linc_luajit https://github.com/nebulazorua/linc_luajit.git -haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc.git diff --git a/source/kec/states/PlayState.hx b/source/kec/states/PlayState.hx index 026324c4..65371187 100644 --- a/source/kec/states/PlayState.hx +++ b/source/kec/states/PlayState.hx @@ -155,7 +155,7 @@ class PlayState extends MusicBeatState var notesHitArray:Array = []; // If The Arrows Are Generated / Shown. - public var arrowsGenerated:Bool = false; + public var arrowsShown:Bool = false; // If Is In PlayState. public static var inDaPlay:Bool = false; @@ -284,9 +284,7 @@ class PlayState extends MusicBeatState public var dialogue:Array = []; // Kinda The Same Thing. - var inCutscene:Bool = false; - - public var inCinematic:Bool = false; + public var inCutscene:Bool = false; // From What I Can Tell, It's Just Used For StageDebugState. public static var stageTesting:Bool = false; @@ -333,6 +331,7 @@ class PlayState extends MusicBeatState var lastPos:Float = -5000; public var correctY = 698; + private var desyncs:Int = 0; private var iDesyncs:Int = 0; @@ -441,10 +440,10 @@ class PlayState extends MusicBeatState switch (storyWeek) { case 7: - inCinematic = true; + inCutscene = true; case 5: if (PlayState.SONG.songId == 'winter-horrorland') - inCinematic = true; + inCutscene = true; } } @@ -695,8 +694,10 @@ class PlayState extends MusicBeatState tweenBoolshit = SONG.songId != 'tutorial' && SONG.songId != 'roses'; - generateStaticArrows(0, tweenBoolshit); - generateStaticArrows(1, tweenBoolshit); + generateStaticArrows(0); + generateStaticArrows(1); + + appearStaticArrows(tweenBoolshit); // If A Song Doesn't Have Events, It Makes One Automatically. @@ -877,9 +878,6 @@ class PlayState extends MusicBeatState for (goil in gfGroup.members) goil.dance(); - if (inCutscene) - removeStaticArrows(true); - if (isStoryMode) { switch (StringTools.replace(curSong, " ", "-").toLowerCase()) @@ -889,7 +887,6 @@ class PlayState extends MusicBeatState add(blackScreen); blackScreen.scrollFactor.set(); camHUD.visible = false; - removeStaticArrows(); FlxTimer.wait(0.1, function() { @@ -906,6 +903,7 @@ class PlayState extends MusicBeatState ease: FlxEase.quadInOut, onComplete: function(twn:FlxTween) { + inCutscene = false; startCountdown(); camHUD.visible = true; } @@ -1196,18 +1194,10 @@ class PlayState extends MusicBeatState return; #end - if (inCinematic || inCutscene) - { - if (!arrowsGenerated) - { - generateStaticArrows(1, true); - - generateStaticArrows(0, true); - } - } - - inCinematic = false; inCutscene = false; + + if (!arrowsShown) + appearStaticArrows(true); Conductor.elapsedPosition = -(Math.floor(Conductor.crochet * 5)); startedCountdown = true; @@ -1858,7 +1848,7 @@ class PlayState extends MusicBeatState } } - private function generateStaticArrows(player:Int, ?tween:Bool = true):Void + private function generateStaticArrows(player:Int):Void { final seX:Float = !PlayStateChangeables.opponentMode ? (PlayStateChangeables.middleScroll ? -278 : 42) : (PlayStateChangeables.middleScroll ? 366 : 42); final seY:Float = strumLine.y; @@ -1868,36 +1858,9 @@ class PlayState extends MusicBeatState var noteTypeCheck:String = 'normal'; babyArrow.downScroll = PlayStateChangeables.useDownscroll; - babyArrow.x += Note.swagWidth * i; - - var targAlpha = 1; - - if (PlayStateChangeables.middleScroll) - { - if (PlayStateChangeables.opponentMode) - { - if (player == 1) - targAlpha = 0; - } - else - { - if (player == 0) - targAlpha = 0; - } - } - - if (tween) - { - babyArrow.y -= 10; - babyArrow.alpha = 0; - createTween(babyArrow, {y: babyArrow.y + 10, alpha: targAlpha}, 1, {ease: FlxEase.circOut, startDelay: 0.5 + (0.2 * i)}); - } - else - babyArrow.alpha = targAlpha; - + babyArrow.alpha = 0; babyArrow.ID = i; - babyArrow.loadLane(); arrowLanes.add(babyArrow.bgLane); @@ -1914,26 +1877,48 @@ class PlayState extends MusicBeatState else cpuStrums.add(babyArrow); } - // babyArrow.x += 98.5; // Tryna make it not offset because it was pissing me off + Psych Engine has it somewhat like this. babyArrow.x += 50; babyArrow.x += ((FlxG.width * 0.5) * player); strumLineNotes.add(babyArrow); } - arrowsGenerated = true; } - private function appearStaticArrows():Void + private function appearStaticArrows(t:Bool = true):Void { - var index = 0; - strumLineNotes.forEach(function(babyArrow:FlxSprite) + if (inCutscene || arrowsShown) + return; + var index:Int = 0; + strumLineNotes.forEachAlive(function(n:StaticArrow) { - if (isStoryMode && !PlayStateChangeables.middleScroll) - babyArrow.visible = true; - if (index > 3 && PlayStateChangeables.middleScroll) - babyArrow.visible = true; + var targAlpha = 1; + + if (PlayStateChangeables.middleScroll) + { + if (PlayStateChangeables.opponentMode) + { + if (index < 3) + targAlpha = 0; + } + else + { + if (index > 4) + targAlpha = 0; + } + } + if (t) + { + n.y -= 10; + n.alpha = 0; + createTween(n, {y: n.y + 10, alpha: targAlpha}, 1, {ease: FlxEase.circOut, startDelay: 0.5 + (0.2 * index % 4)}); + } + else + n.alpha = targAlpha; + index++; }); + + arrowsShown = true; } function tweenCamIn():Void @@ -2349,7 +2334,7 @@ class PlayState extends MusicBeatState camFollowPos.setPosition(camFollow.x, camFollow.y); } - if (generatedMusic && !(inCutscene || inCinematic)) + if (generatedMusic && !inCutscene) { // hell // note scroll code (mostly) @@ -2510,7 +2495,6 @@ class PlayState extends MusicBeatState desyncs++; Debug.logTrace('Vocal Desyncs $desyncs'); } - } } } @@ -3877,39 +3861,6 @@ class PlayState extends MusicBeatState judgementCounter.visible = (hidden) ? FlxG.save.data.judgementCounter : false; } - function removeStaticArrows(?destroy:Bool = false) - { - if (arrowsGenerated) - { - arrowLanes.forEach(function(bgLane:FlxSprite) - { - arrowLanes.remove(bgLane, true); - if (destroy) - arrowLanes.destroy(); - }); - - playerStrums.forEach(function(babyArrow:StaticArrow) - { - playerStrums.remove(babyArrow); - if (destroy) - babyArrow.destroy(); - }); - cpuStrums.forEach(function(babyArrow:StaticArrow) - { - cpuStrums.remove(babyArrow); - if (destroy) - babyArrow.destroy(); - }); - strumLineNotes.forEach(function(babyArrow:StaticArrow) - { - strumLineNotes.remove(babyArrow); - if (destroy) - babyArrow.destroy(); - }); - arrowsGenerated = false; - } - } - function changeNoteSkins(isPlayer:Bool, texture:String) { switch (isPlayer) @@ -4033,7 +3984,6 @@ class PlayState extends MusicBeatState { #if VIDEOS inCutscene = true; - inCinematic = true; var diff:String = CoolUtil.getSuffixFromDiff(CoolUtil.difficulties[storyDifficulty]); cutscene = new VideoHandler(); OpenFlAssets.loadBytes(Paths.video(name)).onComplete(function(bytes:openfl.utils.ByteArray):Void @@ -4111,45 +4061,44 @@ class PlayState extends MusicBeatState private function noteCamera(note:Note) { - if (PlayStateChangeables.noteCamera) - { - var camNoteExtend:Float = 20; + if (!PlayStateChangeables.noteCamera) + return; + var camNoteExtend:Float = 20; - camNoteX = 0; - camNoteY = 0; + camNoteX = 0; + camNoteY = 0; - if (!note.isSustainNote) - { - if (Stage.staticCam) - updateCamFollow(); + if (!note.isSustainNote) + { + if (Stage.staticCam) + updateCamFollow(); - switch (note.noteData) - { - case 0: - camNoteX -= camNoteExtend; - case 1: - camNoteY += camNoteExtend; - case 2: - camNoteY -= camNoteExtend; - case 3: - camNoteX += camNoteExtend; - } + switch (note.noteData) + { + case 0: + camNoteX -= camNoteExtend; + case 1: + camNoteY += camNoteExtend; + case 2: + camNoteY -= camNoteExtend; + case 3: + camNoteX += camNoteExtend; + } - if (camNoteX > camNoteExtend) - camNoteX = camNoteExtend; + if (camNoteX > camNoteExtend) + camNoteX = camNoteExtend; - if (camNoteX < -camNoteExtend) - camNoteX = -camNoteExtend; + if (camNoteX < -camNoteExtend) + camNoteX = -camNoteExtend; - if (camNoteY > camNoteExtend) - camNoteY = camNoteExtend; + if (camNoteY > camNoteExtend) + camNoteY = camNoteExtend; - if (camNoteY < -camNoteExtend) - camNoteY = -camNoteExtend; + if (camNoteY < -camNoteExtend) + camNoteY = -camNoteExtend; - camFollow.x += camNoteX; - camFollow.y += camNoteY; - } + camFollow.x += camNoteX; + camFollow.y += camNoteY; } }