mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 13:11:42 +00:00
fix replay center in mac
This commit is contained in:
parent
d6278b3445
commit
e4c013bec6
1 changed files with 8 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import hxd.fs.BytesFileSystem.BytesFileEntry;
|
||||||
import src.Marbleland;
|
import src.Marbleland;
|
||||||
import src.Mission;
|
import src.Mission;
|
||||||
import hxd.BitmapData;
|
import hxd.BitmapData;
|
||||||
|
|
@ -76,11 +77,15 @@ class ReplayCenterGui extends GuiImage {
|
||||||
var replayList = [];
|
var replayList = [];
|
||||||
sys.FileSystem.createDirectory(haxe.io.Path.join([Settings.settingsDir, "data", "replays"]));
|
sys.FileSystem.createDirectory(haxe.io.Path.join([Settings.settingsDir, "data", "replays"]));
|
||||||
var replayPath = 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) {
|
for (replayFile in replayFiles) {
|
||||||
if (replayFile.extension == "mbr") {
|
var extension = haxe.io.Path.extension(replayFile);
|
||||||
|
if (extension == "mbr") {
|
||||||
var replayF = new Replay(null);
|
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 BytesFileEntry(fullpath, replayBytes);
|
||||||
|
if (replayF.readHeader(replayBytes, fe))
|
||||||
replayList.push(replayF);
|
replayList.push(replayF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue