NAT flixel playground multiple playground views

This commit is contained in:
2022-07-02 23:10:47 +00:00
parent bcd1eca9a0
commit d17ebf9a1d
16 changed files with 104 additions and 92 deletions

View File

@@ -12,10 +12,27 @@
(FileSystem.createDirectory entryDir)
(FileSystem.createDirectory componentDir)
(FileSystem.createDirectory filesDir)
(let [entryFiles (FileSystem.readDirectory entryDir)]
(for file entryFiles
=>(file.withoutExtension)
(the Entry (Json.parse (File.getContent (joinPath archiveDir "entries" file)))))))])
(the Entry (tink.Json.parse (File.getContent (joinPath archiveDir "entries" file)))))))
:DynamicAccess<Dynamic> playgrounds
(let [playgroundsFile (joinPath archiveDir "playgrounds.json")]
(unless (FileSystem.exists playgroundsFile)
(File.saveContent playgroundsFile
#"{
"default": "Playground-MAIN",
"Playground-MAIN": {
"catsMatch": "true"
}
}
"#))
(haxe.Json.parse (File.getContent playgroundsFile)))])
(method changePlaygrounds [:Dynamic->Void change]
(change playgrounds)
(File.saveContent (joinPath archiveDir "playgrounds.json") (haxe.Json.stringify playgrounds "\t")))
(method addSystem [:System system]
// Assign entries to the Systems that care about them
@@ -47,7 +64,7 @@
(method _saveEntry [:Entry e]
(File.saveContent
(joinPath archiveDir "entries" (e.id.withExtension "json"))
(Json.stringify e)))
(tink.Json.stringify e)))
(method fullString [:Entry e]
(haxe.Json.stringify e null "\t"))