Added "active" setting for SpawnAreas. Added cool tooltip to

DialogueGraphView
This commit is contained in:
Zukero
2015-10-30 14:02:38 +01:00
parent f5c454807c
commit 12ca21b9e4
4 changed files with 181 additions and 60 deletions

View File

@@ -12,6 +12,7 @@ public class SpawnArea extends MapObject {
public int quantity = 1;
public int spawnchance = 10;
public boolean active = true;
public List<NPC> spawnGroup = new ArrayList<NPC>();
public SpawnArea(tiled.core.MapObject obj) {
@@ -21,6 +22,9 @@ public class SpawnArea extends MapObject {
if (obj.getProperties().getProperty("spawnchance") != null) {
this.spawnchance = Integer.parseInt(obj.getProperties().getProperty("spawnchance"));
}
if (obj.getProperties().getProperty("active") != null) {
this.active = Boolean.parseBoolean(obj.getProperties().getProperty("active"));
}
}
@Override
@@ -67,6 +71,9 @@ public class SpawnArea extends MapObject {
if (spawnchance != 10) {
tmxObject.getProperties().setProperty("spawnchance", Integer.toString(spawnchance));
}
if (!this.active) {
tmxObject.getProperties().setProperty("active", Boolean.toString(active));
}
}
}