remove nested type annotation when building for gdscript
This commit is contained in:
@@ -18,13 +18,14 @@ using Choice.ChoiceExtension;
|
||||
import hank.HankAST.ExprType;
|
||||
import hank.StoryTree;
|
||||
import hank.Alt.AltInstance;
|
||||
import hank.Types;
|
||||
|
||||
/**
|
||||
Possible states of the story being executed.
|
||||
**/
|
||||
enum StoryFrame {
|
||||
HasText(text:String);
|
||||
HasChoices(choices:Array<String>, tags:Array<Array<String>>);
|
||||
HasChoices(choices:Array<String>, tags:TagArray);
|
||||
Finished;
|
||||
}
|
||||
|
||||
@@ -344,7 +345,7 @@ class Story {
|
||||
for (choiceInfo in choices)
|
||||
choiceInfo.output.format(this, hInterface, random, altInstances, nodeScopes, false)
|
||||
];
|
||||
var tags = [
|
||||
var tags:TagArray = [
|
||||
for (choiceInfo in choices)
|
||||
choiceInfo.tags
|
||||
];
|
||||
@@ -639,7 +640,7 @@ class Story {
|
||||
return removeDoubleSpaces(t).trim();
|
||||
}
|
||||
|
||||
private function finalChoiceProcessing(choices:Array<String>, tags:Array<Array<String>>) {
|
||||
private function finalChoiceProcessing(choices:Array<String>, tags:TagArray) {
|
||||
return HasChoices([for (c in choices) removeDoubleSpaces(c).trim()], tags);
|
||||
}
|
||||
|
||||
@@ -675,7 +676,7 @@ class Story {
|
||||
|
||||
public function run(
|
||||
showText:(String,Void->Void)->Void,
|
||||
showChoices:(Array<String>,Array<Array<String>>,Int->Void)->Void,
|
||||
showChoices:(Array<String>,TagArray,Int->Void)->Void,
|
||||
finish:Void->Void)
|
||||
{
|
||||
var loop = run.bind(showText, showChoices, finish);
|
||||
|
||||
7
hank/Types.hx
Normal file
7
hank/Types.hx
Normal file
@@ -0,0 +1,7 @@
|
||||
package hank;
|
||||
|
||||
#if gdscript
|
||||
typedef TagArray = Array<Dynamic>;
|
||||
#else
|
||||
typedef TagArray = Array<Array<String>>;
|
||||
#end
|
||||
Reference in New Issue
Block a user