From 828c0addc013dbe100c86b8c21f6a9e9e4affccf Mon Sep 17 00:00:00 2001 From: mayo78 <75394229+mayo78@users.noreply.github.com> Date: Sun, 8 Sep 2024 21:03:02 -0400 Subject: [PATCH] custom song support also fix hmm so it almost works you gotta install sscript manually from an archive but its ok --- Project.xml | 8 +++---- hmm.json | 11 +++++++--- source/options/OptionsState.hx | 2 +- source/states/PlayMenu.hx | 39 +++++++++++++++++++++++----------- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/Project.xml b/Project.xml index 1abac01..e98ca1e 100644 --- a/Project.xml +++ b/Project.xml @@ -92,12 +92,10 @@ - - - + + + - - diff --git a/hmm.json b/hmm.json index 2e0ee1c..f27b60f 100644 --- a/hmm.json +++ b/hmm.json @@ -41,17 +41,22 @@ "version": null }, { - "name": "SScript", + "name": "tjson", + "type": "haxelib", + "version": null + }, + { + "name": "hxcpp-debug-server", "type": "haxelib", "version": null }, { - "name": "hxcpp-debug-server", + "name": "tjson", "type": "haxelib", "version": null }, { - "name": "tjson", + "name": "hxvlc", "type": "haxelib", "version": null }, diff --git a/source/options/OptionsState.hx b/source/options/OptionsState.hx index eebfa85..dc50ae3 100644 --- a/source/options/OptionsState.hx +++ b/source/options/OptionsState.hx @@ -27,7 +27,7 @@ class OptionsState extends MusicBeatState override function create() { - #if desktop + #if DISCORD_ALLOWED DiscordClient.changePresence("Options Menu", null); #end diff --git a/source/states/PlayMenu.hx b/source/states/PlayMenu.hx index 80ded79..25649f5 100644 --- a/source/states/PlayMenu.hx +++ b/source/states/PlayMenu.hx @@ -21,6 +21,12 @@ import options.OptionsState; //this a mess +typedef PlayMenuEntry = { + var modDir:String; // auto defines on custom songs + var song:String; + var ?lockReqs:Array; +} + class PlayMenu extends MusicBeatSubstate { public static final hiddenTexts = ['nuhh uh', 'licky lee', 'well this is a little secret haha', 'i just lost my dawggg', 'dingalingaling', 'rofl copter', 'loltastic!', 'food more food!','okwell i cant fucking do thius anymore what the fuck is wrong with this god damn fucking mod adn funky is being a fuckingf annoying little bitch in vc asnd crying about every little god damned thing', 'dinalingaling', 'tophat guy', 'gf with a big butt', 'well... i think fnf gf is bad', 'ok well u have to beat the other sons', 'locked haha', 'penis', 'chubby heros', 'funktastic 2', 'slenderman', 'funny minion gif', 'goofy ahh mod who gets it', '???', 'ego monster', 'dingaling2', 'john doe', 'wanna see my powers', 'follow infry', 'DINGALING DEMON', 'hotbox central', 'wello k', 'ur never gonna fucking see me again after this please know i love you ok?', 'hawk tuah']; @@ -29,8 +35,8 @@ class PlayMenu extends MusicBeatSubstate public static final completeTexts = ['cmm plete', 'd one' , 'goe goe', 'goodbye', 'complete', 'have fun', 'thanks data', 'woah ohoh', 'lets get funkin!', 'bye', 'tophat guy', 'lets play']; - //hardcoded weekdata //could of actually been the meta instead of anon but whatever - static final weekShit:Array<{modDir:String,song:String,lockReqs:Array}> = [ + //hardcoded weekdata //could of actually been the meta instead of anon but whatever //jk its not hardcoded anymore + static final weekShit:Array = [ //main songs {modDir: 'johndoe', song: 'johndoe',lockReqs: []}, {modDir: 'devilish', song: 'devilish',lockReqs: []}, @@ -150,21 +156,30 @@ class PlayMenu extends MusicBeatSubstate return path + '/' + song.substr(0,song.length-4); } + inline function pushEntry(entry:PlayMenuEntry) { + songs.push({ + songName: entry.song, + week: weekShit.length, + modFolder: entry.modDir, + lockReqs: entry.lockReqs ?? [], + }); + } function generateList() { // WeekData.reloadWeekFiles(false); - for (i in 0...weekShit.length) { - var data:RobloxMeta = { - songName: weekShit[i].song, - week: i, - modFolder: weekShit[i].modDir, - lockReqs: weekShit[i].lockReqs - + // keeping hardcoded friends cause of ordering and such + for (entry in weekShit) + pushEntry(entry); + + for (mod in Mods.getModDirectories()) { + final path = Paths.mods('$mod/entry.json'); + if (FileSystem.exists(path)) { + final entry:PlayMenuEntry = cast tjson.TJSON.parse(File.getContent(path).trim()); + entry.modDir = mod; + pushEntry(entry); } - - songs.push(data); } //Mods.loadTopMod(); } @@ -502,7 +517,7 @@ class PlayMenu extends MusicBeatSubstate { FlxG.sound.play(Paths.sound('cancelMenu')); selectedSomethin = false; - update(FlxG.elapsed); + trace('error loading song $e'); return; } killControls();