Skip to content

Commit

Permalink
Update Paths.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Aug 2, 2024
1 parent 4561dd0 commit ae2c2e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/backend/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ class Paths {
inline public static function getText(path:String):Array<String>
return Assets.exists(path) ? [for (i in Assets.getText(path).trim().split('\n')) i.trim()] : [];

static public function getTextFromFile(key:String):String {
#if sys
if (FileSystem.exists(file(key)))
return File.getContent(file(key));
#end

return (Assets.exists(file(key))) ? Assets.getText(file(key)) : null;
}

inline static public function txt(key:String)
return file('data/$key.txt');

Expand Down

0 comments on commit ae2c2e5

Please sign in to comment.