Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom song support #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,10 @@

<!-- _______________________________ Libraries ______________________________ -->

<haxelib name="flixel" version="5.8.0"/>
<haxelib name="flixel-ui" version="2.6.1" />
<haxelib name="flixel-addons" version="3.2.2"/>
<haxelib name="flixel" />
<haxelib name="flixel-ui" />
<haxelib name="flixel-addons"/>
<haxelib name="tjson" />
<haxelib name="compiletime" />
<haxelib name="flixel-screenshot-plugin"/>
<!--Psych stuff needed-->
<haxelib name="linc_luajit" if="LUA_ALLOWED"/>
<haxelib name="SScript" if="HSCRIPT_ALLOWED" version="8.1.6"/>
Expand Down
11 changes: 8 additions & 3 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion source/options/OptionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OptionsState extends MusicBeatState


override function create() {
#if desktop
#if DISCORD_ALLOWED
DiscordClient.changePresence("Options Menu", null);
#end

Expand Down
39 changes: 27 additions & 12 deletions source/states/PlayMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>;
}

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'];
Expand All @@ -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<String>}> = [
//hardcoded weekdata //could of actually been the meta instead of anon but whatever //jk its not hardcoded anymore
static final weekShit:Array<PlayMenuEntry> = [
//main songs
{modDir: 'johndoe', song: 'johndoe',lockReqs: []},
{modDir: 'devilish', song: 'devilish',lockReqs: []},
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
Expand Down