This commit is contained in:
2024-04-13 15:24:59 -06:00
parent 7b5e58ae68
commit 9983e55a96
2 changed files with 29 additions and 0 deletions

28
hank/Main.hx Normal file
View File

@@ -0,0 +1,28 @@
package hank;
import sys.FileSystem;
import hank.Story;
class Main {
static function main() {
var args = Sys.args();
for (arg in args) {
if (FileSystem.exists(arg) && !FileSystem.isDirectory(arg)) {
Sys.println(arg);
Story.FromFile(arg).run((text, cc) -> {
Sys.println(text);
cc();
}, (choices, choose) -> {
for (idx in 0...choices.length) {
Sys.println('${idx+1}. ${choices[idx]}');
}
var choiceIndex = Std.parseInt(Sys.stdin().readLine()) - 1;
choose(choiceIndex);
}, () -> {
Sys.println("THE END");
});
}
}
}
}

View File

@@ -7,6 +7,7 @@
"version": "0.0.8",
"releasenote": "It isn't safe to use this library yet.",
"contributors": ["NQNStudios"],
"main": "hank.Main",
"dependencies": {
"hscript": "",
"utest": ""