Update Tutorial.java

This commit is contained in:
Anuken 2019-09-17 12:27:18 -04:00 committed by GitHub
parent c357b97b3b
commit 02736524bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,7 +187,7 @@ public class Tutorial{
}
},;
protected final String line = Core.bundle.has("tutorial." + name() + ".mobile") && mobile ? "tutorial." + name() + ".mobile" : "tutorial." + name();
protected String line = "";
protected final Function<String, String> text;
protected Array<String> sentences;
protected final BooleanProvider done;
@ -203,7 +203,10 @@ public class Tutorial{
/** displayed tutorial stage text.*/
public String text(){
if(sentences == null) this.sentences = Array.select(Core.bundle.get(line).split("\n"), s -> !s.isEmpty());
if(sentences == null){
this.line = Core.bundle.has("tutorial." + name() + ".mobile") && mobile ? "tutorial." + name() + ".mobile" : "tutorial." + name();
this.sentences = Array.select(Core.bundle.get(line).split("\n"), s -> !s.isEmpty());
}
String line = sentences.get(control.tutorial.sentence);
return line.contains("{") ? text.get(line) : line;
}