diff --git a/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java b/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java index 5574ebe..0fe054f 100644 --- a/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java +++ b/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java @@ -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); diff --git a/src/main/resources/dialogs/error.txt b/src/main/resources/dialogs/error.txt new file mode 100644 index 0000000..8e6200f --- /dev/null +++ b/src/main/resources/dialogs/error.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/resources/dialogs/minecraft.txt b/src/main/resources/dialogs/minecraft.txt index ac731fa..009e3aa 100644 --- a/src/main/resources/dialogs/minecraft.txt +++ b/src/main/resources/dialogs/minecraft.txt @@ -1,7 +1,3 @@ boy3-face.png *slaps rack*
this bad boy can fit so many minecraft servers - error - null -Shit.. - null \ No newline at end of file