Merge pull request #104 from Enbika/linux-replays

Fix replay crashes on non-Windows platforms
This commit is contained in:
Kade M 2021-03-31 11:01:02 -07:00 committed by GitHub
commit 174fffcece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -33,7 +33,7 @@ class LoadReplayState extends MusicBeatState
{
var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
#if sys
controlsStrings = sys.FileSystem.readDirectory(Sys.getCwd() + "\\assets\\replays\\");
controlsStrings = sys.FileSystem.readDirectory(Sys.getCwd() + "/assets/replays/");
#end
trace(controlsStrings);

View File

@ -85,10 +85,10 @@ class Replay
public function LoadFromJSON()
{
#if sys
trace('loading ' + Sys.getCwd() + 'assets\\replays\\' + path + ' replay...');
trace('loading ' + Sys.getCwd() + 'assets/replays/' + path + ' replay...');
try
{
var repl:ReplayJSON = cast Json.parse(File.getContent(Sys.getCwd() + "assets\\replays\\" + path));
var repl:ReplayJSON = cast Json.parse(File.getContent(Sys.getCwd() + "assets/replays/" + path));
replay = repl;
}
catch(e)

View File

@ -52,8 +52,8 @@ class TitleState extends MusicBeatState
#end
#if sys
if (!sys.FileSystem.exists(Sys.getCwd() + "\\assets\\replays"))
sys.FileSystem.createDirectory(Sys.getCwd() + "\\assets\\replays");
if (!sys.FileSystem.exists(Sys.getCwd() + "/assets/replays"))
sys.FileSystem.createDirectory(Sys.getCwd() + "/assets/replays");
#end