fix errors on mac

This commit is contained in:
George FunBook 2021-03-29 23:05:21 -05:00
parent 0f997c84af
commit 38cc859bb4
3 changed files with 14 additions and 6 deletions

View File

@ -1,4 +1,4 @@
{"ATLAS": {"SPRITES":[
{"ATLAS": {"SPRITES":[
{"SPRITE" : {"name": "0000","x":1150,"y":0,"w":387,"h":220,"rotated": false}},
{"SPRITE" : {"name": "0001","x":399,"y":594,"w":194,"h":122,"rotated": false}},
{"SPRITE" : {"name": "0002","x":982,"y":700,"w":88,"h":148,"rotated": false}},

View File

@ -24,7 +24,7 @@ import ui.Prompt;
using StringTools;
#if desktop
#if discord_rpc
import Discord.DiscordClient;
#end
#if newgrounds

View File

@ -83,6 +83,7 @@ class ModMenu extends ui.OptionsState.Page
organizeByY();
}
inline static var MOD_PATH = "./mods";
private function refreshModList():Void
{
while (grpMods.members.length > 0)
@ -93,16 +94,23 @@ class ModMenu extends ui.OptionsState.Page
#if desktop
var modList = [];
modFolders = [];
for (file in FileSystem.readDirectory('./mods'))
trace("mods path:" + FileSystem.absolutePath(MOD_PATH));
if (!FileSystem.exists(MOD_PATH))
{
if (FileSystem.isDirectory('./mods/' + file))
FlxG.log.warn("missing mods folder, expected: " + FileSystem.absolutePath(MOD_PATH));
return;
}
for (file in FileSystem.readDirectory(MOD_PATH))
{
if (FileSystem.isDirectory(MOD_PATH + file))
modFolders.push(file);
}
enabledMods = [];
modList = Polymod.scan('./mods');
modList = Polymod.scan(MOD_PATH);
trace(modList);