diff --git a/core/assets/textureData/sprites/questbubble.png b/core/assets/textureData/sprites/questbubble.png new file mode 100644 index 0000000..c0f73aa Binary files /dev/null and b/core/assets/textureData/sprites/questbubble.png differ diff --git a/core/src/com/trs/main/worldobjects/MovingNpc.java b/core/src/com/trs/main/worldobjects/MovingNpc.java index 0b5558d..0eedbac 100644 --- a/core/src/com/trs/main/worldobjects/MovingNpc.java +++ b/core/src/com/trs/main/worldobjects/MovingNpc.java @@ -8,13 +8,16 @@ package com.trs.main.worldobjects; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.math.Intersector; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Actor; import com.trs.main.Dialogue; import com.trs.main.DialogueParser; +import com.trs.main.InformationQuest; import com.trs.main.Main; +import com.trs.main.Quest; import com.trs.main.StaticMath; import com.trs.main.Textbox; @@ -48,12 +51,16 @@ public class MovingNpc extends Actor{ String dialoguePath; + Texture questBubble;//= new Texture("textureData/sprites/questbubble.png"); + public MovingNpc(Rectangle area, float xPos, float yPos, int id, int mapId, String texture){ setName("npc"); this.id = id; this.mapId = mapId; Texture t = new Texture(Gdx.files.internal("textureData/sprites/"+texture)); + questBubble = new Texture("textureData/sprites/questbubble.png"); + currentlyTalking = false; specialDialogue = false; animatedSprite = new AnimatedSprite(t, 64, 64, true); @@ -211,6 +218,23 @@ public class MovingNpc extends Actor{ @Override public void draw(Batch batch, float parentAlpha) { animatedSprite.draw(batch); + + for(Actor a : getStage().getActors()){ + if(a instanceof Player){ + for(Quest quest : ((Player)a).getQuests()){ + if(quest instanceof InformationQuest){ + if(((InformationQuest)quest).hasSpecialDialogue(id, mapId)){ + batch.draw(questBubble, getX()-8, getY() + getHeight() - 16); + break; + } + } + } + break; + } + } + + + super.draw(batch, parentAlpha); //To change body of generated methods, choose Tools | Templates. } @@ -240,4 +264,5 @@ public class MovingNpc extends Actor{ return t; } + }