fixed dialogs
This commit is contained in:
parent
0bcb8fe0b9
commit
25a20341ea
@ -35,21 +35,23 @@ public class InteractionCell extends Cell {
|
||||
|
||||
public void startEvent() {
|
||||
if (message != null) {
|
||||
window.setCanPersonMove(false);
|
||||
readDialogFile(message);
|
||||
if (message.equals("error")) {
|
||||
final int[] i = {0};
|
||||
timer = new Timer(1000, actionEvent -> {
|
||||
errorEvent(i[0] +1);
|
||||
i[0]++;
|
||||
});
|
||||
timer.start();
|
||||
readDialogFile(message);
|
||||
}
|
||||
else {
|
||||
window.setCanPersonMove(false);
|
||||
readDialogFile(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void readDialogFile(String name) {
|
||||
if (message.equals("error")) {
|
||||
final int[] i = {0};
|
||||
timer = new Timer(1000, actionEvent -> {
|
||||
errorEvent(i[0] +1);
|
||||
i[0]++;
|
||||
});
|
||||
timer.start();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
File dialogFile = new File("src/main/resources/dialogs/" + name + ".txt");
|
||||
scanner = new Scanner(dialogFile);
|
||||
|
||||
1
src/main/resources/dialogs/error.txt
Normal file
1
src/main/resources/dialogs/error.txt
Normal file
@ -0,0 +1 @@
|
||||
<end>
|
||||
@ -1,7 +1,3 @@
|
||||
<image> boy3-face.png
|
||||
*slaps rack*<br/>this bad boy can fit so many minecraft servers
|
||||
<foreground> error
|
||||
<image> null
|
||||
Shit..
|
||||
<foreground> null
|
||||
<end>
|
||||
Loading…
x
Reference in New Issue
Block a user