mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix replay center on mac
This commit is contained in:
parent
72f13ba68b
commit
4f23c2cea9
1 changed files with 7 additions and 3 deletions
|
|
@ -49,11 +49,15 @@ class ReplayCenterGui extends GuiImage {
|
|||
var replayList = [];
|
||||
sys.FileSystem.createDirectory(haxe.io.Path.join([Settings.settingsDir, "data", "replays"]));
|
||||
var replayPath = haxe.io.Path.join([Settings.settingsDir, "data", "replays",]);
|
||||
var replayFiles = ResourceLoader.fileSystem.dir(replayPath);
|
||||
var replayFiles = sys.FileSystem.readDirectory(replayPath);
|
||||
for (replayFile in replayFiles) {
|
||||
if (replayFile.extension == "mbr") {
|
||||
var extension = haxe.io.Path.extension(replayFile);
|
||||
if (extension == "mbr") {
|
||||
var replayF = new Replay(null);
|
||||
if (replayF.readHeader(replayFile.getBytes(), replayFile))
|
||||
var fullpath = haxe.io.Path.join([Settings.settingsDir, "data", "replays", replayFile]);
|
||||
var replayBytes = sys.io.File.getBytes(fullpath);
|
||||
var fe = new hxd.fs.BytesFileSystem.BytesFileEntry(fullpath, replayBytes);
|
||||
if (replayF.readHeader(replayBytes, fe))
|
||||
replayList.push(replayF);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue