Skip to content

Commit adefa90

Browse files
EliteMasterEricKade-github
authored andcommitted
Fix several issues preventing builds on HTML5
1 parent 03d4608 commit adefa90

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

hmm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"name": "lime",
144144
"type": "git",
145145
"dir": null,
146-
"ref": "1e79c20a6ee13fa168535f9f76a368e3284ddc3a",
146+
"ref": "be81ad7e4e1a92c3482bcc009648a4ac892cfa35",
147147
"url": "https://github.com/FunkinCrew/lime"
148148
},
149149
{

source/funkin/util/FileUtil.hx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,17 @@ class FileUtil
5353
* Paths which should not be deleted or modified by scripts.
5454
*/
5555
private static final PROTECTED_PATHS:Array<String> = [
56-
'', 'assets', 'manifest', 'manifest/*', 'plugins', 'plugins/*', 'Funkin.exe', 'Funkin', 'libvlc.dll', 'libvlccore.dll', 'lime.ndll'
56+
'',
57+
'assets',
58+
'manifest',
59+
'manifest/*',
60+
'plugins',
61+
'plugins/*',
62+
'Funkin.exe',
63+
'Funkin',
64+
'libvlc.dll',
65+
'libvlccore.dll',
66+
'lime.ndll'
5767
];
5868

5969
/**
@@ -269,7 +279,7 @@ class FileUtil
269279

270280
return true;
271281
#elseif html5
272-
var filter:String = defaultFileName != null ? Path.extension(defaultFileName) : null;
282+
var filter:Null<String> = defaultFileName != null ? Path.extension(defaultFileName) : null;
273283
var fileDialog:FileDialog = new FileDialog();
274284
if (onSave != null)
275285
{

source/funkin/util/WindowUtil.hx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ class WindowUtil
6969
*/
7070
public static function openFolder(targetPath:String):Void
7171
{
72+
#if html5
73+
throw 'Cannot open URLs on this platform.';
74+
#else
7275
if (!sys.FileSystem.exists(targetPath) || !sys.FileSystem.isDirectory(targetPath)) throw 'openFolder should only be used to open existing folders.';
7376
#if FEATURE_OPEN_URL
7477
#if windows
@@ -81,6 +84,7 @@ class WindowUtil
8184
#else
8285
throw 'Cannot open URLs on this platform.';
8386
#end
87+
#end
8488
}
8589

8690
/**
@@ -89,6 +93,9 @@ class WindowUtil
8993
*/
9094
public static function openSelectFile(targetPath:String):Void
9195
{
96+
#if html5
97+
throw 'Cannot open URLs on this platform.';
98+
#else
9299
#if FEATURE_OPEN_URL
93100
#if windows
94101
Sys.command('explorer', ['/select,' + targetPath.replace('/', '\\')]);
@@ -101,6 +108,7 @@ class WindowUtil
101108
#else
102109
throw 'Cannot open URLs on this platform.';
103110
#end
111+
#end
104112
}
105113

106114
/**

source/funkin/util/macro/RegistryMacro.hx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import haxe.macro.Expr.TypeDefKind;
88
import haxe.macro.Expr.MetadataEntry;
99
import haxe.macro.Type;
1010
import haxe.macro.Type.ClassType;
11-
import sys.FileSystem;
1211

1312
using Lambda;
1413
using haxe.macro.ExprTools;
@@ -362,7 +361,7 @@ class RegistryMacro
362361
static function listBaseGameEntryIds(dataFilePath:String):Array<Expr>
363362
{
364363
var result:Array<Expr> = [];
365-
var files:Array<String> = FileSystem.readDirectory(dataFilePath);
364+
var files:Array<String> = sys.FileSystem.readDirectory(dataFilePath);
366365

367366
for (file in files)
368367
{

0 commit comments

Comments
 (0)