From 7162b4dd86bdbcbe18c59258f0f7f1ece5a70130 Mon Sep 17 00:00:00 2001 From: Detoria <44783518+theDetourist@users.noreply.github.com> Date: Thu, 15 Apr 2021 12:29:28 -0300 Subject: [PATCH] offset desktop only pt.2 --- source/PlayState.hx | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 4409319..44c1dbd 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -39,10 +39,10 @@ import lime.utils.Assets; import openfl.display.BlendMode; import openfl.display.StageQuality; import openfl.filters.ShaderFilter; -import Sys; #if windows import Discord.DiscordClient; +import Sys; #end using StringTools; @@ -1230,23 +1230,26 @@ class PlayState extends MusicBeatState var playerCounter:Int = 0; // Per song offset check - var songPath = 'assets/data/' + PlayState.SONG.song.toLowerCase() + '/'; - for(file in sys.FileSystem.readDirectory(songPath)) - { - var path = haxe.io.Path.join([songPath, file]); - if(!sys.FileSystem.isDirectory(path)) + #if desktop + var songPath = 'assets/data/' + PlayState.SONG.song.toLowerCase() + '/'; + for(file in sys.FileSystem.readDirectory(songPath)) { - if(path.endsWith('.offset')) + var path = haxe.io.Path.join([songPath, file]); + if(!sys.FileSystem.isDirectory(path)) { - trace('Found offset file: ' + path); - songOffset = Std.parseFloat(file.substring(0, file.indexOf('.off'))); - break; - }else { - trace('Offset file not found. Creating one @: ' + songPath); - sys.io.File.saveContent(songPath + songOffset + '.offset', ''); + if(path.endsWith('.offset')) + { + trace('Found offset file: ' + path); + songOffset = Std.parseFloat(file.substring(0, file.indexOf('.off'))); + break; + }else { + trace('Offset file not found. Creating one @: ' + songPath); + sys.io.File.saveContent(songPath + songOffset + '.offset', ''); + } } } - } + #end + var daBeats:Int = 0; // Not exactly representative of 'daBeats' lol, just how much it has looped for (section in noteData) { @@ -3270,4 +3273,4 @@ class PlayState extends MusicBeatState } var curLight:Int = 0; -} \ No newline at end of file +}