Dialogue bug fixed

master
Jonathan Hager 5 years ago
parent 2f293db027
commit d2ff8dfe4b

@ -74,7 +74,31 @@ public class MovingNpc extends Actor{
@Override
public void act(float delta) {
if(Main.gamestate == 0) {
if(Main.gamestate == 1 && currentlyTalking) {
animatedSprite.setRow(facing);
if(currentlyTalking) {
for(Actor a : getStage().getActors().toArray(Actor.class)) {
if(a instanceof Textbox) {
if(((Textbox) a).getState() == 2) {
int answer = ((Textbox) a).getSelectedAsw();
Dialogue newDialogue = parser.nextDialogue(answer + 1);
if(newDialogue == null) {
currentlyTalking = false;
parser = new DialogueParser("npcs/"+id+"/dialogue/test.txt");
System.out.println("asdfasdf");
}
else {
((Textbox)a).update(newDialogue);
System.out.println("update nicencie");
}
}
}
}
}
}
else {
if(POI == null || Math.random() < 0.01f){
POI = new Vector2(area.getX() + ((float) Math.random() * (float) area.getWidth()), area.getY() + ((float) Math.random() * (float) area.getHeight()));
}
@ -139,30 +163,6 @@ public class MovingNpc extends Actor{
movementX = 0;
movementY = 0;
}
else if(Main.gamestate == 1) {
animatedSprite.setRow(facing);
if(currentlyTalking) {
for(Actor a : getStage().getActors().toArray(Actor.class)) {
if(a instanceof Textbox) {
if(((Textbox) a).getState() == 2) {
int answer = ((Textbox) a).getSelectedAsw();
Dialogue newDialogue = parser.nextDialogue(answer + 1);
if(newDialogue == null) {
currentlyTalking = false;
parser = new DialogueParser("npcs/"+id+"/dialogue/test.txt");
System.out.println("asdfasdf");
}
else {
((Textbox)a).update(newDialogue);
System.out.println("update nicencie");
}
}
}
}
}
}
animatedSprite.updateAnimation(delta);

Loading…
Cancel
Save